update gitignore
7
.gitignore
vendored
|
@ -1,2 +1,7 @@
|
||||||
/target
|
/target/debug
|
||||||
|
/target/package
|
||||||
|
/target/release
|
||||||
|
/target/.rustc_info.json
|
||||||
|
/target/.rustdoc_fingerprint.json
|
||||||
|
/target/CACHEDIR.TAG
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
|
0
target/doc/.lock
Executable file
50
target/doc/COPYRIGHT.txt
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
These documentation pages include resources by third parties. This copyright
|
||||||
|
file applies only to those resources. The following third party resources are
|
||||||
|
included, and carry their own copyright notices and license terms:
|
||||||
|
|
||||||
|
* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2,
|
||||||
|
FiraSans-Regular.woff, FiraSans-Medium.woff):
|
||||||
|
|
||||||
|
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
|
||||||
|
with Reserved Font Name Fira Sans.
|
||||||
|
|
||||||
|
Copyright (c) 2014, Telefonica S.A.
|
||||||
|
|
||||||
|
Licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
See FiraSans-LICENSE.txt.
|
||||||
|
|
||||||
|
* rustdoc.css, main.js, and playpen.js:
|
||||||
|
|
||||||
|
Copyright 2015 The Rust Developers.
|
||||||
|
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
|
||||||
|
the MIT license (LICENSE-MIT.txt) at your option.
|
||||||
|
|
||||||
|
* normalize.css:
|
||||||
|
|
||||||
|
Copyright (c) Nicolas Gallagher and Jonathan Neal.
|
||||||
|
Licensed under the MIT license (see LICENSE-MIT.txt).
|
||||||
|
|
||||||
|
* Source Code Pro (SourceCodePro-Regular.ttf.woff2,
|
||||||
|
SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2,
|
||||||
|
SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff,
|
||||||
|
SourceCodePro-It.ttf.woff):
|
||||||
|
|
||||||
|
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
|
||||||
|
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
|
||||||
|
of Adobe Systems Incorporated in the United States and/or other countries.
|
||||||
|
|
||||||
|
Licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
See SourceCodePro-LICENSE.txt.
|
||||||
|
|
||||||
|
* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2,
|
||||||
|
SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff,
|
||||||
|
SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff):
|
||||||
|
|
||||||
|
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name
|
||||||
|
'Source'. All Rights Reserved. Source is a trademark of Adobe in the United
|
||||||
|
States and/or other countries.
|
||||||
|
|
||||||
|
Licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
See SourceSerif4-LICENSE.md.
|
||||||
|
|
||||||
|
This copyright file is intended to be distributed with rustdoc output.
|
94
target/doc/FiraSans-LICENSE.txt
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
|
||||||
|
with Reserved Font Name < Fira >,
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
target/doc/FiraSans-Medium.woff
Normal file
BIN
target/doc/FiraSans-Medium.woff2
Normal file
BIN
target/doc/FiraSans-Regular.woff
Normal file
BIN
target/doc/FiraSans-Regular.woff2
Normal file
201
target/doc/LICENSE-APACHE.txt
Normal file
|
@ -0,0 +1,201 @@
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
23
target/doc/LICENSE-MIT.txt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
Permission is hereby granted, free of charge, to any
|
||||||
|
person obtaining a copy of this software and associated
|
||||||
|
documentation files (the "Software"), to deal in the
|
||||||
|
Software without restriction, including without
|
||||||
|
limitation the rights to use, copy, modify, merge,
|
||||||
|
publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software
|
||||||
|
is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice
|
||||||
|
shall be included in all copies or substantial portions
|
||||||
|
of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||||
|
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||||
|
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||||
|
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||||
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
99
target/doc/NanumBarunGothic-LICENSE.txt
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/),
|
||||||
|
|
||||||
|
with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic,
|
||||||
|
NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen,
|
||||||
|
Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco,
|
||||||
|
NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic,
|
||||||
|
Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
target/doc/NanumBarunGothic.ttf.woff
Normal file
BIN
target/doc/NanumBarunGothic.ttf.woff2
Normal file
BIN
target/doc/SourceCodePro-It.ttf.woff
Normal file
BIN
target/doc/SourceCodePro-It.ttf.woff2
Normal file
93
target/doc/SourceCodePro-LICENSE.txt
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
|
||||||
|
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
target/doc/SourceCodePro-Regular.ttf.woff
Normal file
BIN
target/doc/SourceCodePro-Regular.ttf.woff2
Normal file
BIN
target/doc/SourceCodePro-Semibold.ttf.woff
Normal file
BIN
target/doc/SourceCodePro-Semibold.ttf.woff2
Normal file
BIN
target/doc/SourceSerif4-Bold.ttf.woff
Normal file
BIN
target/doc/SourceSerif4-Bold.ttf.woff2
Normal file
BIN
target/doc/SourceSerif4-It.ttf.woff
Normal file
BIN
target/doc/SourceSerif4-It.ttf.woff2
Normal file
93
target/doc/SourceSerif4-LICENSE.md
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
|
||||||
|
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
target/doc/SourceSerif4-Regular.ttf.woff
Normal file
BIN
target/doc/SourceSerif4-Regular.ttf.woff2
Normal file
1
target/doc/ayu.css
Normal file
1
target/doc/brush.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1792" height="1792" viewBox="0 0 1792 1792"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg>
|
After Width: | Height: | Size: 455 B |
1
target/doc/clipboard.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg width="24" height="25" viewBox="0 0 24 25" xmlns="http://www.w3.org/2000/svg" aria-label="Copy to clipboard"><path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"/><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"/></svg>
|
After Width: | Height: | Size: 576 B |
1
target/doc/crates.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
window.ALL_CRATES = ["libfar"];
|
1
target/doc/dark.css
Normal file
1
target/doc/down-arrow.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="128" height="128" enable-background="new 0 0 128 128" version="1.1" viewBox="-30 -20 176 176" xml:space="preserve"><g><line x1="111" x2="64" y1="40.5" y2="87.499" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/><line x1="64" x2="17" y1="87.499" y2="40.5" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/></g></svg>
|
After Width: | Height: | Size: 510 B |
BIN
target/doc/favicon-16x16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
target/doc/favicon-32x32.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
24
target/doc/favicon.svg
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;">
|
||||||
|
<defs>
|
||||||
|
<style type="text/css"><![CDATA[
|
||||||
|
#logo {
|
||||||
|
fill-rule: nonzero;
|
||||||
|
}
|
||||||
|
#logo-teeth {
|
||||||
|
stroke: #000000;
|
||||||
|
stroke-width: 0.92px;
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
#logo {
|
||||||
|
fill: #FFFFFF;
|
||||||
|
fill-rule: nonzero;
|
||||||
|
}
|
||||||
|
#logo-teeth {
|
||||||
|
fill: #FFFFFF;
|
||||||
|
stroke: #FFFFFF;
|
||||||
|
stroke-width: 0.92px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]></style>
|
||||||
|
</defs>
|
||||||
|
<path id="logo" d="M15.993,1.54c-7.972,0 -14.461,6.492 -14.461,14.462c0,7.969 6.492,14.461 14.461,14.461c7.97,0 14.462,-6.492 14.462,-14.461c0,-7.97 -6.492,-14.462 -14.462,-14.462Zm-0.021,1.285c0.511,0.013 0.924,0.439 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0.001 0.028,0.001Zm2.178,1.566c3.379,0.633 6.313,2.723 8.016,5.709l-1.123,2.533c-0.193,0.438 0.006,0.952 0.44,1.147l2.16,0.958c0.067,0.675 0.076,1.355 0.025,2.031l-1.202,0c-0.12,0 -0.169,0.08 -0.169,0.196l0,0.551c0,1.297 -0.731,1.582 -1.373,1.652c-0.612,0.07 -1.288,-0.257 -1.374,-0.63c-0.361,-2.029 -0.961,-2.46 -1.909,-3.21c1.178,-0.746 2.401,-1.85 2.401,-3.325c0,-1.594 -1.092,-2.597 -1.835,-3.09c-1.046,-0.688 -2.203,-0.826 -2.515,-0.826l-12.421,0c1.717,-1.918 4.02,-3.218 6.55,-3.696l1.466,1.536c0.33,0.346 0.878,0.361 1.223,0.028l1.64,-1.564Zm-13.522,7.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.951 0.951,-0.951c0.009,0 0.019,0 0.028,0Zm22.685,0.043c0.511,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.43,0.952 -0.952,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.01,0 0.019,0 0.028,0.001Zm-20.892,0.153l1.658,0l0,7.477l-3.347,0c-0.414,-1.452 -0.542,-2.97 -0.38,-4.47l2.05,-0.912c0.438,-0.195 0.637,-0.706 0.441,-1.144l-0.422,-0.951Zm6.92,0.079l3.949,0c0.205,0 1.441,0.236 1.441,1.163c0,0.768 -0.948,1.043 -1.728,1.043l-3.665,0l0.003,-2.206Zm0,5.373l3.026,0c0.275,0 1.477,0.079 1.86,1.615c0.119,0.471 0.385,2.007 0.566,2.499c0.18,0.551 0.911,1.652 1.691,1.652l4.938,0c-0.331,0.444 -0.693,0.863 -1.083,1.255l-2.01,-0.432c-0.468,-0.101 -0.93,0.199 -1.031,0.667l-0.477,2.228c-3.104,1.406 -6.672,1.389 -9.762,-0.046l-0.478,-2.228c-0.101,-0.468 -0.56,-0.767 -1.028,-0.667l-1.967,0.423c-0.365,-0.377 -0.704,-0.778 -1.016,-1.2l9.567,0c0.107,0 0.181,-0.018 0.181,-0.119l0,-3.384c0,-0.097 -0.074,-0.119 -0.181,-0.119l-2.799,0l0.003,-2.144Zm-4.415,7.749c0.512,0.015 0.924,0.44 0.924,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.952,-0.43 -0.952,-0.952c0,0 0,0 0,0c0,-0.522 0.43,-0.952 0.952,-0.952c0.009,0 0.018,0.001 0.027,0.001Zm14.089,0.043c0.511,0.015 0.924,0.439 0.923,0.951c0,0.522 -0.429,0.952 -0.951,0.952c-0.522,0 -0.951,-0.43 -0.951,-0.952c0,0 0,0 0,0c0,-0.522 0.429,-0.952 0.951,-0.952c0.009,0 0.018,0 0.028,0.001Z"/><path id="logo-teeth" d="M29.647,16.002c0,7.49 -6.163,13.653 -13.654,13.653c-7.49,0 -13.654,-6.163 -13.654,-13.653c0,-7.491 6.164,-13.654 13.654,-13.654c7.491,0 13.654,6.163 13.654,13.654Zm-0.257,-1.319l2.13,1.319l-2.13,1.318l1.83,1.71l-2.344,0.878l1.463,2.035l-2.475,0.404l1.04,2.282l-2.506,-0.089l0.575,2.442l-2.441,-0.576l0.089,2.506l-2.283,-1.04l-0.403,2.475l-2.035,-1.462l-0.878,2.343l-1.71,-1.829l-1.319,2.129l-1.318,-2.129l-1.71,1.829l-0.878,-2.343l-2.035,1.462l-0.404,-2.475l-2.282,1.04l0.089,-2.506l-2.442,0.576l0.575,-2.442l-2.505,0.089l1.04,-2.282l-2.475,-0.404l1.462,-2.035l-2.343,-0.878l1.829,-1.71l-2.129,-1.318l2.129,-1.319l-1.829,-1.71l2.343,-0.878l-1.462,-2.035l2.475,-0.404l-1.04,-2.282l2.505,0.089l-0.575,-2.441l2.442,0.575l-0.089,-2.506l2.282,1.04l0.404,-2.475l2.035,1.463l0.878,-2.344l1.71,1.83l1.318,-2.13l1.319,2.13l1.71,-1.83l0.878,2.344l2.035,-1.463l0.403,2.475l2.283,-1.04l-0.089,2.506l2.441,-0.575l-0.575,2.441l2.506,-0.089l-1.04,2.282l2.475,0.404l-1.463,2.035l2.344,0.878l-1.83,1.71Z"/></svg>
|
After Width: | Height: | Size: 4.2 KiB |
3
target/doc/implementors/core/marker/trait.Freeze.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl Freeze for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl Freeze for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl Freeze for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
3
target/doc/implementors/core/marker/trait.Send.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
3
target/doc/implementors/core/marker/trait.Sync.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
3
target/doc/implementors/core/marker/trait.Unpin.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html\" title=\"trait core::panic::unwind_safe::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html\" title=\"trait core::panic::unwind_safe::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html\" title=\"trait core::panic::unwind_safe::RefUnwindSafe\">RefUnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
|
@ -0,0 +1,3 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["libfar"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html\" title=\"trait core::panic::unwind_safe::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFileInfo.html\" title=\"struct libfar::farlib::FarFileInfo\">FarFileInfo</a>","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html\" title=\"trait core::panic::unwind_safe::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarFile.html\" title=\"struct libfar::farlib::FarFile\">FarFile</a>","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html\" title=\"trait core::panic::unwind_safe::UnwindSafe\">UnwindSafe</a> for <a class=\"struct\" href=\"libfar/farlib/struct.FarArchive.html\" title=\"struct libfar::farlib::FarArchive\">FarArchive</a>","synthetic":true,"types":["libfar::farlib::FarArchive"]}];
|
||||||
|
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
6
target/doc/libfar/all.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Crate libfar</h2><div class="block version"><p>Version 0.1.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../libfar/index.html"><img class="rust-logo" src="../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span>
|
||||||
|
</span>
|
||||||
|
</h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="farlib/struct.FarArchive.html">farlib::FarArchive</a></li><li><a href="farlib/struct.FarFile.html">farlib::FarFile</a></li><li><a href="farlib/struct.FarFileInfo.html">farlib::FarFileInfo</a></li></ul><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="farlib/fn.test.html">farlib::test</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
19
target/doc/libfar/farlib/fn.test.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Tests if a buffer is a valid FarArchive. Returns a FarArchive struct if it is, or an error if it is not."><meta name="keywords" content="rust, rustlang, rust-lang, test"><title>test in libfar::farlib - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a></h2><div id="sidebar-vars" data-name="test" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a>::<wbr><a class="fn" href="#">test</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/libfar/farlib.rs.html#249-267" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust fn"><code>pub fn test(file: &<a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a>, <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Tests if a buffer is a valid FarArchive.
|
||||||
|
Returns a FarArchive struct if it is, or an error if it is not.</p>
|
||||||
|
<h2 id="examples" class="section-header"><a href="#examples">Examples</a></h2>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::fs</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">fs::read</span>(<span class="string">"test.far"</span>).<span class="ident">expect</span>(<span class="string">"Failed to read file"</span>);
|
||||||
|
<span class="kw">let</span> <span class="ident">test</span> <span class="op">=</span> <span class="ident">farlib::test</span>(<span class="kw-2">&</span><span class="ident">buffer</span>);
|
||||||
|
<span class="kw">match</span> <span class="ident">test</span> {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">archive</span>) => {
|
||||||
|
<span class="macro">println!</span>(<span class="string">"test.far is a valid archive"</span>);
|
||||||
|
},
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">e</span>) => {
|
||||||
|
<span class="macro">println!</span>(<span class="string">"test.far is not a valid archive: {}"</span>, <span class="ident">e</span>);
|
||||||
|
}
|
||||||
|
}</code></pre></div>
|
||||||
|
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
14
target/doc/libfar/farlib/index.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `farlib` mod in crate `libfar`."><meta name="keywords" content="rust, rustlang, rust-lang, farlib"><title>libfar::farlib - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Module farlib</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="farlib" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">libfar</a>::<wbr><a class="mod" href="#">farlib</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/libfar/farlib.rs.html#1-305" title="goto source code">[src]</a></span></h1><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||||
|
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FarArchive.html" title="libfar::farlib::FarArchive struct">FarArchive</a></div><div class="item-right docblock-short"><p>Struct containing information about an archive.</p>
|
||||||
|
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FarFile.html" title="libfar::farlib::FarFile struct">FarFile</a></div><div class="item-right docblock-short"><p>Struct containing a file, whether or not it’s in an archive.
|
||||||
|
This should be used when creating a file from a buffer, or when getting files from an archive.</p>
|
||||||
|
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FarFileInfo.html" title="libfar::farlib::FarFileInfo struct">FarFileInfo</a></div><div class="item-right docblock-short"><p>Struct containing information about a file, without reading the actual data of the file.
|
||||||
|
This should be used in cases where file information is needed to be retrieved quickly
|
||||||
|
(e.g. when listing files in an archive).</p>
|
||||||
|
</div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
|
||||||
|
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.test.html" title="libfar::farlib::test fn">test</a></div><div class="item-right docblock-short"><p>Tests if a buffer is a valid FarArchive.
|
||||||
|
Returns a FarArchive struct if it is, or an error if it is not.</p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
1
target/doc/libfar/farlib/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"fn":[["test","Tests if a buffer is a valid FarArchive. Returns a FarArchive struct if it is, or an error if it is not."]],"struct":[["FarArchive","Struct containing information about an archive."],["FarFile","Struct containing a file, whether or not it’s in an archive. This should be used when creating a file from a buffer, or when getting files from an archive."],["FarFileInfo","Struct containing information about a file, without reading the actual data of the file. This should be used in cases where file information is needed to be retrieved quickly (e.g. when listing files in an archive)."]]});
|
68
target/doc/libfar/farlib/struct.FarArchive.html
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Struct containing information about an archive."><meta name="keywords" content="rust, rustlang, rust-lang, FarArchive"><title>FarArchive in libfar::farlib - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Struct FarArchive</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.file_count">file_count</a><a href="#structfield.file_data">file_data</a><a href="#structfield.file_list">file_list</a><a href="#structfield.version">version</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.load_file_data">load_file_data</a><a href="#method.new_from_files">new_from_files</a><a href="#method.to_vec">to_vec</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a></h2><div id="sidebar-vars" data-name="FarArchive" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a>::<wbr><a class="struct" href="#">FarArchive</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/libfar/farlib.rs.html#42-47" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust struct"><code>pub struct FarArchive {
|
||||||
|
pub version: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>,
|
||||||
|
pub file_count: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>,
|
||||||
|
pub file_list: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a>>,
|
||||||
|
pub file_data: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a>>,
|
||||||
|
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Struct containing information about an archive.</p>
|
||||||
|
<p>Should be created by one of two ways:</p>
|
||||||
|
<ol>
|
||||||
|
<li>Calling <code>FarArchive::new_from_files</code> if creating an archive from a list of FarFile structs</li>
|
||||||
|
<li>Calling <code>farlib::test(buffer)</code> if loading an archive from a file/buffer</li>
|
||||||
|
</ol>
|
||||||
|
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.version" class="structfield small-section-header"><a href="#structfield.version" class="anchor field"></a><code>version: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></code></span><span id="structfield.file_count" class="structfield small-section-header"><a href="#structfield.file_count" class="anchor field"></a><code>file_count: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></code></span><span id="structfield.file_list" class="structfield small-section-header"><a href="#structfield.file_list" class="anchor field"></a><code>file_list: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a>></code></span><span id="structfield.file_data" class="structfield small-section-header"><a href="#structfield.file_data" class="anchor field"></a><code>file_data: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#90-229" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_from_files" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#114-133" title="goto source code">[src]</a></div><a href="#method.new_from_files" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new_from_files" class="fnname">new_from_files</a>(files: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a>>) -> <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h4></div></summary><div class="docblock"><p>Creates a new FarArchive struct from a list of FarFile structs.
|
||||||
|
Important when creating a new archive.</p>
|
||||||
|
<h5 id="examples" class="section-header"><a href="#examples">Examples</a></h5>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// file_names is a Vec<String> containing the names of the files</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">std::fs</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_list</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">file</span> <span class="kw">in</span> <span class="ident">file_names</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">file_name</span> <span class="op">=</span> <span class="ident">file</span>.<span class="ident">split</span>(<span class="string">"/"</span>).<span class="ident">last</span>().<span class="ident">unwrap</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">file_size</span> <span class="op">=</span> <span class="ident">fs::metadata</span>(<span class="ident">file</span>.<span class="ident">clone</span>()).<span class="ident">expect</span>(<span class="string">"Failed to get file size"</span>).<span class="ident">len</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">file_data</span> <span class="op">=</span> <span class="ident">fs::read</span>(<span class="ident">file</span>.<span class="ident">clone</span>()).<span class="ident">expect</span>(<span class="string">"Failed to read file"</span>);
|
||||||
|
<span class="kw">let</span> <span class="ident">file_obj</span> <span class="op">=</span> <span class="ident">farlib::FarFile</span> {
|
||||||
|
<span class="ident">name</span>: <span class="ident">file_name</span>.<span class="ident">to_string</span>(),
|
||||||
|
<span class="ident">size</span>: <span class="ident">file_size</span> <span class="kw">as</span> <span class="ident">u32</span>,
|
||||||
|
<span class="ident">data</span>: <span class="ident">file_data</span>
|
||||||
|
};
|
||||||
|
<span class="ident">file_list</span>.<span class="ident">push</span>(<span class="ident">file_obj</span>);
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">archive</span> <span class="op">=</span> <span class="ident">farlib::FarArchive::new_from_files</span>(<span class="ident">file_list</span>);</code></pre></div>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.load_file_data" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#151-167" title="goto source code">[src]</a></div><a href="#method.load_file_data" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.load_file_data" class="fnname">load_file_data</a>(self, original_file: &<a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>>) -> <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h4></div></summary><div class="docblock"><p>Loads file data into a FarArchive struct, used if a FarFileInfo struct is not sufficient.</p>
|
||||||
|
<h5 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h5>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// buffer is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">test</span> <span class="op">=</span> <span class="ident">farlib::test</span>(<span class="kw-2">&</span><span class="ident">buffer</span>);
|
||||||
|
<span class="kw">match</span> <span class="ident">test</span> {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">archive</span>) => {
|
||||||
|
<span class="kw">let</span> <span class="ident">archive</span> <span class="op">=</span> <span class="ident">archive</span>.<span class="ident">load_file_data</span>(<span class="kw-2">&</span><span class="ident">buffer</span>);
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">e</span>) => {
|
||||||
|
<span class="macro">println!</span>(<span class="string">"{} is not a valid archive: {}"</span>, <span class="ident">archive_name</span>, <span class="ident">e</span>);
|
||||||
|
}
|
||||||
|
}</code></pre></div>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.to_vec" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#183-228" title="goto source code">[src]</a></div><a href="#method.to_vec" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.to_vec" class="fnname">to_vec</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>></h4></div></summary><div class="docblock"><p>Creates a buffer representing the contents of a FarArchive struct.
|
||||||
|
Can be written to a file to create a .far archive.</p>
|
||||||
|
<h5 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h5>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// archive is a FarArchive struct</span>
|
||||||
|
<span class="comment">// archive_name is the name of the file we will write the archive to</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">std::fs</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">std::io::Write</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">archive</span>.<span class="ident">to_vec</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">fs::File::create</span>(<span class="ident">archive_name</span>.<span class="ident">clone</span>()).<span class="ident">expect</span>(<span class="string">"Failed to create file"</span>);
|
||||||
|
<span class="ident">file</span>.<span class="ident">write_all</span>(<span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">archive_obj</span>.<span class="ident">to_vec</span>()).<span class="ident">expect</span>(<span class="string">"Failed to write file"</span>);</code></pre></div>
|
||||||
|
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.FarArchive.html" title="struct libfar::farlib::FarArchive">FarArchive</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.59.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#209-214" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#211" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#218-222" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#219" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#550-554" title="goto source code">[src]</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#551" title="goto source code">[src]</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#538-545" title="goto source code">[src]</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#542" title="goto source code">[src]</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#588-597" title="goto source code">[src]</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#594" title="goto source code">[src]</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#574-583" title="goto source code">[src]</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#580" title="goto source code">[src]</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
46
target/doc/libfar/farlib/struct.FarFile.html
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Struct containing a file, whether or not it’s in an archive. This should be used when creating a file from a buffer, or when getting files from an archive."><meta name="keywords" content="rust, rustlang, rust-lang, FarFile"><title>FarFile in libfar::farlib - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Struct FarFile</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.data">data</a><a href="#structfield.name">name</a><a href="#structfield.size">size</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.new_from_archive">new_from_archive</a><a href="#method.new_from_file">new_from_file</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a></h2><div id="sidebar-vars" data-name="FarFile" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a>::<wbr><a class="struct" href="#">FarFile</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/libfar/farlib.rs.html#31-35" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust struct"><code>pub struct FarFile {
|
||||||
|
pub name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||||
|
pub size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>,
|
||||||
|
pub data: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>>,
|
||||||
|
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Struct containing a file, whether or not it’s in an archive.
|
||||||
|
This should be used when creating a file from a buffer, or when getting files from an archive.</p>
|
||||||
|
<p>Should be created by calling <code>FarFile::new_from_archive</code> if extracting from an archive, or
|
||||||
|
<code>FarFile::new_from_file</code> if reading from a buffer.</p>
|
||||||
|
<h2 id="examples" class="section-header"><a href="#examples">Examples</a></h2>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// buffer is a Vec<u8> containing the contents of a file</span>
|
||||||
|
<span class="comment">// fileA_name is the name of the file</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib::FarFile</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">fileA</span> <span class="op">=</span> <span class="ident">FarFile::new_from_file</span>(<span class="ident">fileA_name</span>, <span class="ident">buffer</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">buffer</span>);
|
||||||
|
|
||||||
|
<span class="comment">// archive_buf is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="comment">// fileB_name is the name of the file that we got from reading the manifest</span>
|
||||||
|
<span class="comment">// fileB_size is the size of the file that we got from reading the manifest</span>
|
||||||
|
<span class="comment">// fileB_offset is the offset of the file that we got from reading the manifest</span>
|
||||||
|
<span class="kw">let</span> <span class="ident">fileB</span> <span class="op">=</span> <span class="ident">FarFile::new_from_archive</span>(<span class="ident">fileB_name</span>, <span class="ident">fileB_size</span>, <span class="ident">fileB_offset</span>, <span class="ident">archive_buf</span>);</code></pre></div>
|
||||||
|
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.name" class="structfield small-section-header"><a href="#structfield.name" class="anchor field"></a><code>name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.size" class="structfield small-section-header"><a href="#structfield.size" class="anchor field"></a><code>size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></code></span><span id="structfield.data" class="structfield small-section-header"><a href="#structfield.data" class="anchor field"></a><code>data: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#49-88" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_from_archive" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#61-70" title="goto source code">[src]</a></div><a href="#method.new_from_archive" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new_from_archive" class="fnname">new_from_archive</a>(<br> name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <br> size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>, <br> offset: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>, <br> original_file: &<a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>><br>) -> <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h4></div></summary><div class="docblock"><p>Creates a new FarFile struct from an offset, size, and archive buffer.</p>
|
||||||
|
<h5 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h5>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// archive_buf is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="comment">// file_name is the name of the file that we got from reading the manifest</span>
|
||||||
|
<span class="comment">// file_size is the size of the file that we got from reading the manifest</span>
|
||||||
|
<span class="comment">// file_offset is the offset of the file that we got from reading the manifest</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib::FarFile</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">FarFile::new_from_archive</span>(<span class="ident">file_name</span>, <span class="ident">file_size</span>, <span class="ident">file_offset</span>, <span class="ident">archive_buf</span>);</code></pre></div>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_from_file" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/libfar/farlib.rs.html#81-87" title="goto source code">[src]</a></div><a href="#method.new_from_file" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new_from_file" class="fnname">new_from_file</a>(name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>, data: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u8.html">u8</a>>) -> <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h4></div></summary><div class="docblock"><p>Creates a new FarFile struct from a size, and data buffer.</p>
|
||||||
|
<h5 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h5>
|
||||||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// buffer is a Vec<u8> containing the contents of a file</span>
|
||||||
|
<span class="comment">// file_name is the name of the file</span>
|
||||||
|
<span class="kw">use</span> <span class="ident">libfar::farlib::FarFile</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">FarFile::new_from_file</span>(<span class="ident">file_name</span>, <span class="ident">buffer</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">buffer</span>);</code></pre></div>
|
||||||
|
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.FarFile.html" title="struct libfar::farlib::FarFile">FarFile</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.59.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#209-214" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#211" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#218-222" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#219" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#550-554" title="goto source code">[src]</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#551" title="goto source code">[src]</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#538-545" title="goto source code">[src]</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#542" title="goto source code">[src]</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#588-597" title="goto source code">[src]</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#594" title="goto source code">[src]</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#574-583" title="goto source code">[src]</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#580" title="goto source code">[src]</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
20
target/doc/libfar/farlib/struct.FarFileInfo.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Struct containing information about a file, without reading the actual data of the file. This should be used in cases where file information is needed to be retrieved quickly (e.g. when listing files in an archive)."><meta name="keywords" content="rust, rustlang, rust-lang, FarFileInfo"><title>FarFileInfo in libfar::farlib - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Struct FarFileInfo</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.name">name</a><a href="#structfield.size">size</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a></h2><div id="sidebar-vars" data-name="FarFileInfo" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">libfar</a>::<wbr><a href="index.html">farlib</a>::<wbr><a class="struct" href="#">FarFileInfo</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/libfar/farlib.rs.html#6-10" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust struct"><code>pub struct FarFileInfo {
|
||||||
|
pub name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||||
|
pub size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>,
|
||||||
|
// some fields omitted
|
||||||
|
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Struct containing information about a file, without reading the actual data of the file.
|
||||||
|
This should be used in cases where file information is needed to be retrieved quickly
|
||||||
|
(e.g. when listing files in an archive).</p>
|
||||||
|
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.name" class="structfield small-section-header"><a href="#structfield.name" class="anchor field"></a><code>name: <a class="struct" href="https://doc.rust-lang.org/1.59.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.size" class="structfield small-section-header"><a href="#structfield.size" class="anchor field"></a><code>size: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></code></span><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.FarFileInfo.html" title="struct libfar::farlib::FarFileInfo">FarFileInfo</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.59.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#209-214" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#211" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#218-222" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#219" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#550-554" title="goto source code">[src]</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#551" title="goto source code">[src]</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#538-545" title="goto source code">[src]</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#542" title="goto source code">[src]</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#588-597" title="goto source code">[src]</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#594" title="goto source code">[src]</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#574-583" title="goto source code">[src]</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#580" title="goto source code">[src]</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||||
|
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
5
target/doc/libfar/index.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `libfar` crate."><meta name="keywords" content="rust, rustlang, rust-lang, libfar"><title>libfar - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Crate libfar</h2><div class="block version"><div class="narrow-helper"></div><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all libfar's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li></ul></div><div id="sidebar-vars" data-name="libfar" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../libfar/index.html"><img class="rust-logo" src="../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">libfar</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/libfar/lib.rs.html#1" title="goto source code">[src]</a></span></h1><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||||
|
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="farlib/index.html" title="libfar::farlib mod">farlib</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
1
target/doc/libfar/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"mod":[["farlib",""]]});
|
1
target/doc/light.css
Normal file
8
target/doc/main.js
Normal file
2
target/doc/normalize.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||||
|
html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
|
1
target/doc/noscript.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}.sub{display:none;}#theme-picker{display:none;}
|
BIN
target/doc/rust-logo.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
1
target/doc/rustdoc.css
Normal file
4
target/doc/search-index.js
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchIndex = JSON.parse('{\
|
||||||
|
"libfar":{"doc":"","t":[0,3,3,3,11,11,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,12,12,11,11,11,12,12,5,11,11,11,11,11,11,11,11,11,11,12],"n":["farlib","FarArchive","FarFile","FarFileInfo","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","data","file_count","file_data","file_list","from","from","from","into","into","into","load_file_data","name","name","new_from_archive","new_from_file","new_from_files","size","size","test","to_vec","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","version"],"q":["libfar","libfar::farlib","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["","Struct containing information about an archive.","Struct containing a file, whether or not it’s in an …","Struct containing information about a file, without …","","","","","","","","","","","","","","","","","Loads file data into a FarArchive struct, used if a …","","","Creates a new FarFile struct from an offset, size, and …","Creates a new FarFile struct from a size, and data buffer.","Creates a new FarArchive struct from a list of FarFile …","","","Tests if a buffer is a valid FarArchive. Returns a …","Creates a buffer representing the contents of a FarArchive …","","","","","","","","","",""],"i":[0,0,0,0,1,2,3,1,2,3,2,3,3,3,1,2,3,1,2,3,3,1,2,2,2,3,1,2,0,3,1,2,3,1,2,3,1,2,3,3],"f":[null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[["vec",3]],["fararchive",3]],null,null,[[["string",3],["u32",15],["u32",15],["vec",3]],["farfile",3]],[[["string",3],["u32",15],["vec",3,[["u8",15]]]],["farfile",3]],[[["vec",3,[["farfile",3]]]],["fararchive",3]],null,null,[[["vec",3]],["result",4,[["fararchive",3],["string",3]]]],[[],["vec",3,[["u8",15]]]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],null],"p":[[3,"FarFileInfo"],[3,"FarFile"],[3,"FarArchive"]]}\
|
||||||
|
}');
|
||||||
|
if (window.initSearch) {window.initSearch(searchIndex)};
|
1
target/doc/search.js
Normal file
1
target/doc/settings.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.setting-line{padding:5px;position:relative;}.setting-line>div{display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{opacity:0;position:absolute;}.select-wrapper{float:right;position:relative;height:27px;min-width:25%;}.select-wrapper select{appearance:none;-moz-appearance:none;-webkit-appearance:none;background:none;border:2px solid #ccc;padding-right:28px;width:100%;}.select-wrapper img{pointer-events:none;position:absolute;right:0;bottom:0;background:#ccc;height:100%;width:28px;padding:0px 4px;}.select-wrapper select option{color:initial;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}
|
5
target/doc/settings.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</title><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="./normalize.css"><link rel="stylesheet" type="text/css" href="./rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="./ayu.css" disabled><link rel="stylesheet" type="text/css" href="./dark.css" disabled><link rel="stylesheet" type="text/css" href="./light.css" id="themeStyle"><script id="default-settings" ></script><script src="./storage.js"></script><script src="./crates.js"></script><script defer src="./main.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="alternate icon" type="image/png" href="./favicon-16x16.png"><link rel="alternate icon" type="image/png" href="./favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="./favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="./libfar/index.html"><div class="logo-container"><img class="rust-logo" src="./rust-logo.png" alt="logo"></div>
|
||||||
|
</a><h2 class="location">Settings</h2><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="./libfar/index.html"><img class="rust-logo" src="./rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="./brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="./settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="./wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Rustdoc settings</span></h1><div class="settings"><div class="setting-line"><div class="title">Theme preferences</div><div class="sub-settings"><div class="setting-line"><label class="toggle"><input type="checkbox" id="use-system-theme" checked><span class="slider"></span></label><div>Use system theme</div></div><div class="setting-line"><div>Preferred dark theme</div><label class="select-wrapper"><select id="preferred-dark-theme" autocomplete="off"><option value="light" >light</option><option value="dark" selected>dark</option><option value="ayu" >ayu</option></select><img src="./down-arrow.svg" alt="Select item"></label></div><div class="setting-line"><div>Preferred light theme</div><label class="select-wrapper"><select id="preferred-light-theme" autocomplete="off"><option value="light" selected>light</option><option value="dark" >dark</option><option value="ayu" >ayu</option></select><img src="./down-arrow.svg" alt="Select item"></label></div></div>
|
||||||
|
</div><div class="setting-line"><label class="toggle"><input type="checkbox" id="auto-hide-large-items" checked><span class="slider"></span></label><div>Auto-hide item contents for large items.</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="auto-hide-method-docs" ><span class="slider"></span></label><div>Auto-hide item methods' documentation</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="auto-hide-trait-implementations" ><span class="slider"></span></label><div>Auto-hide trait implementation documentation</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="go-to-only-result" ><span class="slider"></span></label><div>Directly go to item in search if there is only one result</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="line-numbers" ><span class="slider"></span></label><div>Show line numbers on code examples</div></div><div class="setting-line"><label class="toggle"><input type="checkbox" id="disable-shortcuts" ><span class="slider"></span></label><div>Disable keyboard shortcuts</div></div></div><link rel="stylesheet" href="./settings.css"><script src="./settings.js"></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="./" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
1
target/doc/settings.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(){function changeSetting(settingName,value){updateLocalStorage("rustdoc-"+settingName,value);switch(settingName){case"preferred-dark-theme":case"preferred-light-theme":case"use-system-theme":updateSystemTheme();break}}function handleKey(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return}switch(getVirtualKey(ev)){case"Enter":case"Return":case"Space":ev.target.checked=!ev.target.checked;ev.preventDefault();break}}function setEvents(){onEachLazy(document.getElementsByClassName("slider"),function(elem){var toggle=elem.previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)};toggle.onkeyup=handleKey;toggle.onkeyrelease=handleKey});onEachLazy(document.getElementsByClassName("select-wrapper"),function(elem){var select=elem.getElementsByTagName("select")[0];var settingId=select.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){select.value=settingValue}select.onchange=function(){changeSetting(this.id,this.value)}})}window.addEventListener("DOMContentLoaded",setEvents)})()
|
3
target/doc/source-files.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
var N = null;var sourcesIndex = {};
|
||||||
|
sourcesIndex["libfar"] = {"name":"","files":["farlib.rs","lib.rs"]};
|
||||||
|
createSourceSidebar();
|
1
target/doc/source-script.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(){function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0,len=rootPathParts.length;i<len;++i){if(rootPathParts[i]===".."){parts.pop()}}var file=window.location.pathname.substring(parts.join("/").length);if(file.startsWith("/")){file=file.substring(1)}return file.substring(0,file.length-5)}function createDirEntry(elem,parent,fullPath,currentFile,hasFoundFile){var name=document.createElement("div");name.className="name";fullPath+=elem["name"]+"/";name.onclick=function(){if(hasClass(this,"expand")){removeClass(this,"expand")}else{addClass(this,"expand")}};name.innerText=elem["name"];var i,len;var children=document.createElement("div");children.className="children";var folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(i=0,len=elem.dirs.length;i<len;++i){if(createDirEntry(elem.dirs[i],folders,fullPath,currentFile,hasFoundFile)){addClass(name,"expand");hasFoundFile=true}}}children.appendChild(folders);var files=document.createElement("div");files.className="files";if(elem.files){for(i=0,len=elem.files.length;i<len;++i){var file=document.createElement("a");file.innerText=elem.files[i];file.href=window.rootPath+"src/"+fullPath+elem.files[i]+".html";if(!hasFoundFile&¤tFile===fullPath+elem.files[i]){file.className="selected";addClass(name,"expand");hasFoundFile=true}files.appendChild(file)}}search.fullPath=fullPath;children.appendChild(files);parent.appendChild(name);parent.appendChild(children);return hasFoundFile&¤tFile.startsWith(fullPath)}function toggleSidebar(){var sidebar=document.querySelector("nav.sidebar");var child=this.children[0];if(child.innerText===">"){sidebar.classList.add("expanded");child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.classList.remove("expanded");child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner=document.createElement("div");if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}sidebarToggle.appendChild(inner);return sidebarToggle}function createSourceSidebar(){if(!window.rootPath.endsWith("/")){window.rootPath+="/"}var container=document.querySelector("nav.sidebar");var sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){container.classList.remove("expanded")}else{container.classList.add("expanded")}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});container.insertBefore(sidebar,document.querySelector(".sidebar-logo").nextSibling);var selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}var lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(scrollTo,match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to<from){var tmp=to;to=from;from=tmp}var elem=document.getElementById(from);if(!elem){return}if(scrollTo){var x=document.getElementById(from);if(x){x.scrollIntoView()}}onEachLazy(document.getElementsByClassName("line-numbers"),function(e){onEachLazy(e.getElementsByTagName("span"),function(i_e){removeClass(i_e,"line-highlighted")})});for(var i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}var handleSourceHighlight=(function(){var prev_line_id=0;var set_fragment=function(name){var x=window.scrollX,y=window.scrollY;if(searchState.browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines(true)}else{location.replace("#"+name)}window.scrollTo(x,y)};return function(ev){var cur_line_id=parseInt(ev.target.id,10);ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",function(){var match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(false,match)}});onEachLazy(document.getElementsByClassName("line-numbers"),function(el){el.addEventListener("click",handleSourceHighlight)});highlightSourceLines(true);window.createSourceSidebar=createSourceSidebar})()
|
614
target/doc/src/libfar/farlib.rs.html
Normal file
|
@ -0,0 +1,614 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/farlib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>farlib.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script><script defer src="../../source-script.js"></script><script defer src="../../source-files.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||||
|
<span id="2"> 2</span>
|
||||||
|
<span id="3"> 3</span>
|
||||||
|
<span id="4"> 4</span>
|
||||||
|
<span id="5"> 5</span>
|
||||||
|
<span id="6"> 6</span>
|
||||||
|
<span id="7"> 7</span>
|
||||||
|
<span id="8"> 8</span>
|
||||||
|
<span id="9"> 9</span>
|
||||||
|
<span id="10"> 10</span>
|
||||||
|
<span id="11"> 11</span>
|
||||||
|
<span id="12"> 12</span>
|
||||||
|
<span id="13"> 13</span>
|
||||||
|
<span id="14"> 14</span>
|
||||||
|
<span id="15"> 15</span>
|
||||||
|
<span id="16"> 16</span>
|
||||||
|
<span id="17"> 17</span>
|
||||||
|
<span id="18"> 18</span>
|
||||||
|
<span id="19"> 19</span>
|
||||||
|
<span id="20"> 20</span>
|
||||||
|
<span id="21"> 21</span>
|
||||||
|
<span id="22"> 22</span>
|
||||||
|
<span id="23"> 23</span>
|
||||||
|
<span id="24"> 24</span>
|
||||||
|
<span id="25"> 25</span>
|
||||||
|
<span id="26"> 26</span>
|
||||||
|
<span id="27"> 27</span>
|
||||||
|
<span id="28"> 28</span>
|
||||||
|
<span id="29"> 29</span>
|
||||||
|
<span id="30"> 30</span>
|
||||||
|
<span id="31"> 31</span>
|
||||||
|
<span id="32"> 32</span>
|
||||||
|
<span id="33"> 33</span>
|
||||||
|
<span id="34"> 34</span>
|
||||||
|
<span id="35"> 35</span>
|
||||||
|
<span id="36"> 36</span>
|
||||||
|
<span id="37"> 37</span>
|
||||||
|
<span id="38"> 38</span>
|
||||||
|
<span id="39"> 39</span>
|
||||||
|
<span id="40"> 40</span>
|
||||||
|
<span id="41"> 41</span>
|
||||||
|
<span id="42"> 42</span>
|
||||||
|
<span id="43"> 43</span>
|
||||||
|
<span id="44"> 44</span>
|
||||||
|
<span id="45"> 45</span>
|
||||||
|
<span id="46"> 46</span>
|
||||||
|
<span id="47"> 47</span>
|
||||||
|
<span id="48"> 48</span>
|
||||||
|
<span id="49"> 49</span>
|
||||||
|
<span id="50"> 50</span>
|
||||||
|
<span id="51"> 51</span>
|
||||||
|
<span id="52"> 52</span>
|
||||||
|
<span id="53"> 53</span>
|
||||||
|
<span id="54"> 54</span>
|
||||||
|
<span id="55"> 55</span>
|
||||||
|
<span id="56"> 56</span>
|
||||||
|
<span id="57"> 57</span>
|
||||||
|
<span id="58"> 58</span>
|
||||||
|
<span id="59"> 59</span>
|
||||||
|
<span id="60"> 60</span>
|
||||||
|
<span id="61"> 61</span>
|
||||||
|
<span id="62"> 62</span>
|
||||||
|
<span id="63"> 63</span>
|
||||||
|
<span id="64"> 64</span>
|
||||||
|
<span id="65"> 65</span>
|
||||||
|
<span id="66"> 66</span>
|
||||||
|
<span id="67"> 67</span>
|
||||||
|
<span id="68"> 68</span>
|
||||||
|
<span id="69"> 69</span>
|
||||||
|
<span id="70"> 70</span>
|
||||||
|
<span id="71"> 71</span>
|
||||||
|
<span id="72"> 72</span>
|
||||||
|
<span id="73"> 73</span>
|
||||||
|
<span id="74"> 74</span>
|
||||||
|
<span id="75"> 75</span>
|
||||||
|
<span id="76"> 76</span>
|
||||||
|
<span id="77"> 77</span>
|
||||||
|
<span id="78"> 78</span>
|
||||||
|
<span id="79"> 79</span>
|
||||||
|
<span id="80"> 80</span>
|
||||||
|
<span id="81"> 81</span>
|
||||||
|
<span id="82"> 82</span>
|
||||||
|
<span id="83"> 83</span>
|
||||||
|
<span id="84"> 84</span>
|
||||||
|
<span id="85"> 85</span>
|
||||||
|
<span id="86"> 86</span>
|
||||||
|
<span id="87"> 87</span>
|
||||||
|
<span id="88"> 88</span>
|
||||||
|
<span id="89"> 89</span>
|
||||||
|
<span id="90"> 90</span>
|
||||||
|
<span id="91"> 91</span>
|
||||||
|
<span id="92"> 92</span>
|
||||||
|
<span id="93"> 93</span>
|
||||||
|
<span id="94"> 94</span>
|
||||||
|
<span id="95"> 95</span>
|
||||||
|
<span id="96"> 96</span>
|
||||||
|
<span id="97"> 97</span>
|
||||||
|
<span id="98"> 98</span>
|
||||||
|
<span id="99"> 99</span>
|
||||||
|
<span id="100">100</span>
|
||||||
|
<span id="101">101</span>
|
||||||
|
<span id="102">102</span>
|
||||||
|
<span id="103">103</span>
|
||||||
|
<span id="104">104</span>
|
||||||
|
<span id="105">105</span>
|
||||||
|
<span id="106">106</span>
|
||||||
|
<span id="107">107</span>
|
||||||
|
<span id="108">108</span>
|
||||||
|
<span id="109">109</span>
|
||||||
|
<span id="110">110</span>
|
||||||
|
<span id="111">111</span>
|
||||||
|
<span id="112">112</span>
|
||||||
|
<span id="113">113</span>
|
||||||
|
<span id="114">114</span>
|
||||||
|
<span id="115">115</span>
|
||||||
|
<span id="116">116</span>
|
||||||
|
<span id="117">117</span>
|
||||||
|
<span id="118">118</span>
|
||||||
|
<span id="119">119</span>
|
||||||
|
<span id="120">120</span>
|
||||||
|
<span id="121">121</span>
|
||||||
|
<span id="122">122</span>
|
||||||
|
<span id="123">123</span>
|
||||||
|
<span id="124">124</span>
|
||||||
|
<span id="125">125</span>
|
||||||
|
<span id="126">126</span>
|
||||||
|
<span id="127">127</span>
|
||||||
|
<span id="128">128</span>
|
||||||
|
<span id="129">129</span>
|
||||||
|
<span id="130">130</span>
|
||||||
|
<span id="131">131</span>
|
||||||
|
<span id="132">132</span>
|
||||||
|
<span id="133">133</span>
|
||||||
|
<span id="134">134</span>
|
||||||
|
<span id="135">135</span>
|
||||||
|
<span id="136">136</span>
|
||||||
|
<span id="137">137</span>
|
||||||
|
<span id="138">138</span>
|
||||||
|
<span id="139">139</span>
|
||||||
|
<span id="140">140</span>
|
||||||
|
<span id="141">141</span>
|
||||||
|
<span id="142">142</span>
|
||||||
|
<span id="143">143</span>
|
||||||
|
<span id="144">144</span>
|
||||||
|
<span id="145">145</span>
|
||||||
|
<span id="146">146</span>
|
||||||
|
<span id="147">147</span>
|
||||||
|
<span id="148">148</span>
|
||||||
|
<span id="149">149</span>
|
||||||
|
<span id="150">150</span>
|
||||||
|
<span id="151">151</span>
|
||||||
|
<span id="152">152</span>
|
||||||
|
<span id="153">153</span>
|
||||||
|
<span id="154">154</span>
|
||||||
|
<span id="155">155</span>
|
||||||
|
<span id="156">156</span>
|
||||||
|
<span id="157">157</span>
|
||||||
|
<span id="158">158</span>
|
||||||
|
<span id="159">159</span>
|
||||||
|
<span id="160">160</span>
|
||||||
|
<span id="161">161</span>
|
||||||
|
<span id="162">162</span>
|
||||||
|
<span id="163">163</span>
|
||||||
|
<span id="164">164</span>
|
||||||
|
<span id="165">165</span>
|
||||||
|
<span id="166">166</span>
|
||||||
|
<span id="167">167</span>
|
||||||
|
<span id="168">168</span>
|
||||||
|
<span id="169">169</span>
|
||||||
|
<span id="170">170</span>
|
||||||
|
<span id="171">171</span>
|
||||||
|
<span id="172">172</span>
|
||||||
|
<span id="173">173</span>
|
||||||
|
<span id="174">174</span>
|
||||||
|
<span id="175">175</span>
|
||||||
|
<span id="176">176</span>
|
||||||
|
<span id="177">177</span>
|
||||||
|
<span id="178">178</span>
|
||||||
|
<span id="179">179</span>
|
||||||
|
<span id="180">180</span>
|
||||||
|
<span id="181">181</span>
|
||||||
|
<span id="182">182</span>
|
||||||
|
<span id="183">183</span>
|
||||||
|
<span id="184">184</span>
|
||||||
|
<span id="185">185</span>
|
||||||
|
<span id="186">186</span>
|
||||||
|
<span id="187">187</span>
|
||||||
|
<span id="188">188</span>
|
||||||
|
<span id="189">189</span>
|
||||||
|
<span id="190">190</span>
|
||||||
|
<span id="191">191</span>
|
||||||
|
<span id="192">192</span>
|
||||||
|
<span id="193">193</span>
|
||||||
|
<span id="194">194</span>
|
||||||
|
<span id="195">195</span>
|
||||||
|
<span id="196">196</span>
|
||||||
|
<span id="197">197</span>
|
||||||
|
<span id="198">198</span>
|
||||||
|
<span id="199">199</span>
|
||||||
|
<span id="200">200</span>
|
||||||
|
<span id="201">201</span>
|
||||||
|
<span id="202">202</span>
|
||||||
|
<span id="203">203</span>
|
||||||
|
<span id="204">204</span>
|
||||||
|
<span id="205">205</span>
|
||||||
|
<span id="206">206</span>
|
||||||
|
<span id="207">207</span>
|
||||||
|
<span id="208">208</span>
|
||||||
|
<span id="209">209</span>
|
||||||
|
<span id="210">210</span>
|
||||||
|
<span id="211">211</span>
|
||||||
|
<span id="212">212</span>
|
||||||
|
<span id="213">213</span>
|
||||||
|
<span id="214">214</span>
|
||||||
|
<span id="215">215</span>
|
||||||
|
<span id="216">216</span>
|
||||||
|
<span id="217">217</span>
|
||||||
|
<span id="218">218</span>
|
||||||
|
<span id="219">219</span>
|
||||||
|
<span id="220">220</span>
|
||||||
|
<span id="221">221</span>
|
||||||
|
<span id="222">222</span>
|
||||||
|
<span id="223">223</span>
|
||||||
|
<span id="224">224</span>
|
||||||
|
<span id="225">225</span>
|
||||||
|
<span id="226">226</span>
|
||||||
|
<span id="227">227</span>
|
||||||
|
<span id="228">228</span>
|
||||||
|
<span id="229">229</span>
|
||||||
|
<span id="230">230</span>
|
||||||
|
<span id="231">231</span>
|
||||||
|
<span id="232">232</span>
|
||||||
|
<span id="233">233</span>
|
||||||
|
<span id="234">234</span>
|
||||||
|
<span id="235">235</span>
|
||||||
|
<span id="236">236</span>
|
||||||
|
<span id="237">237</span>
|
||||||
|
<span id="238">238</span>
|
||||||
|
<span id="239">239</span>
|
||||||
|
<span id="240">240</span>
|
||||||
|
<span id="241">241</span>
|
||||||
|
<span id="242">242</span>
|
||||||
|
<span id="243">243</span>
|
||||||
|
<span id="244">244</span>
|
||||||
|
<span id="245">245</span>
|
||||||
|
<span id="246">246</span>
|
||||||
|
<span id="247">247</span>
|
||||||
|
<span id="248">248</span>
|
||||||
|
<span id="249">249</span>
|
||||||
|
<span id="250">250</span>
|
||||||
|
<span id="251">251</span>
|
||||||
|
<span id="252">252</span>
|
||||||
|
<span id="253">253</span>
|
||||||
|
<span id="254">254</span>
|
||||||
|
<span id="255">255</span>
|
||||||
|
<span id="256">256</span>
|
||||||
|
<span id="257">257</span>
|
||||||
|
<span id="258">258</span>
|
||||||
|
<span id="259">259</span>
|
||||||
|
<span id="260">260</span>
|
||||||
|
<span id="261">261</span>
|
||||||
|
<span id="262">262</span>
|
||||||
|
<span id="263">263</span>
|
||||||
|
<span id="264">264</span>
|
||||||
|
<span id="265">265</span>
|
||||||
|
<span id="266">266</span>
|
||||||
|
<span id="267">267</span>
|
||||||
|
<span id="268">268</span>
|
||||||
|
<span id="269">269</span>
|
||||||
|
<span id="270">270</span>
|
||||||
|
<span id="271">271</span>
|
||||||
|
<span id="272">272</span>
|
||||||
|
<span id="273">273</span>
|
||||||
|
<span id="274">274</span>
|
||||||
|
<span id="275">275</span>
|
||||||
|
<span id="276">276</span>
|
||||||
|
<span id="277">277</span>
|
||||||
|
<span id="278">278</span>
|
||||||
|
<span id="279">279</span>
|
||||||
|
<span id="280">280</span>
|
||||||
|
<span id="281">281</span>
|
||||||
|
<span id="282">282</span>
|
||||||
|
<span id="283">283</span>
|
||||||
|
<span id="284">284</span>
|
||||||
|
<span id="285">285</span>
|
||||||
|
<span id="286">286</span>
|
||||||
|
<span id="287">287</span>
|
||||||
|
<span id="288">288</span>
|
||||||
|
<span id="289">289</span>
|
||||||
|
<span id="290">290</span>
|
||||||
|
<span id="291">291</span>
|
||||||
|
<span id="292">292</span>
|
||||||
|
<span id="293">293</span>
|
||||||
|
<span id="294">294</span>
|
||||||
|
<span id="295">295</span>
|
||||||
|
<span id="296">296</span>
|
||||||
|
<span id="297">297</span>
|
||||||
|
<span id="298">298</span>
|
||||||
|
<span id="299">299</span>
|
||||||
|
<span id="300">300</span>
|
||||||
|
<span id="301">301</span>
|
||||||
|
<span id="302">302</span>
|
||||||
|
<span id="303">303</span>
|
||||||
|
<span id="304">304</span>
|
||||||
|
<span id="305">305</span>
|
||||||
|
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::io</span>::{<span class="ident">BufReader</span>, <span class="ident">Read</span>};
|
||||||
|
|
||||||
|
<span class="doccomment">/// Struct containing information about a file, without reading the actual data of the file.</span>
|
||||||
|
<span class="doccomment">/// This should be used in cases where file information is needed to be retrieved quickly</span>
|
||||||
|
<span class="doccomment">/// (e.g. when listing files in an archive).</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FarFileInfo</span> {
|
||||||
|
<span class="kw">pub</span> <span class="ident">name</span>: <span class="ident">String</span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">size</span>: <span class="ident">u32</span>,
|
||||||
|
<span class="ident">offset</span>: <span class="ident">u32</span>,
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Struct containing a file, whether or not it's in an archive.</span>
|
||||||
|
<span class="doccomment">/// This should be used when creating a file from a buffer, or when getting files from an archive.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// Should be created by calling `FarFile::new_from_archive` if extracting from an archive, or</span>
|
||||||
|
<span class="doccomment">/// `FarFile::new_from_file` if reading from a buffer.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // buffer is a Vec<u8> containing the contents of a file</span>
|
||||||
|
<span class="doccomment">/// // fileA_name is the name of the file</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib::FarFile;</span>
|
||||||
|
<span class="doccomment">/// let fileA = FarFile::new_from_file(fileA_name, buffer.len() as u32, buffer);</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// // archive_buf is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="doccomment">/// // fileB_name is the name of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// // fileB_size is the size of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// // fileB_offset is the offset of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// let fileB = FarFile::new_from_archive(fileB_name, fileB_size, fileB_offset, archive_buf);</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FarFile</span> {
|
||||||
|
<span class="kw">pub</span> <span class="ident">name</span>: <span class="ident">String</span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">size</span>: <span class="ident">u32</span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">data</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>,
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Struct containing information about an archive.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// Should be created by one of two ways:</span>
|
||||||
|
<span class="doccomment">/// 1. Calling `FarArchive::new_from_files` if creating an archive from a list of FarFile structs</span>
|
||||||
|
<span class="doccomment">/// 2. Calling `farlib::test(buffer)` if loading an archive from a file/buffer</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">FarArchive</span> {
|
||||||
|
<span class="kw">pub</span> <span class="ident">version</span>: <span class="ident">u32</span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">file_count</span>: <span class="ident">u32</span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">file_list</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FarFileInfo</span><span class="op">></span>,
|
||||||
|
<span class="kw">pub</span> <span class="ident">file_data</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">FarFile</span><span class="op">></span>,
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">impl</span> <span class="ident">FarFile</span> {
|
||||||
|
<span class="doccomment">/// Creates a new FarFile struct from an offset, size, and archive buffer.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // archive_buf is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="doccomment">/// // file_name is the name of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// // file_size is the size of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// // file_offset is the offset of the file that we got from reading the manifest</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib::FarFile;</span>
|
||||||
|
<span class="doccomment">/// let file = FarFile::new_from_archive(file_name, file_size, file_offset, archive_buf);</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_from_archive</span>(<span class="ident">name</span> : <span class="ident">String</span>, <span class="ident">size</span> : <span class="ident">u32</span>, <span class="ident">offset</span> : <span class="ident">u32</span>, <span class="ident">original_file</span> : <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) -> <span class="ident">FarFile</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">BufReader::new</span>(<span class="kw-2">&</span><span class="ident">original_file</span>[<span class="ident">offset</span> <span class="kw">as</span> <span class="ident">usize</span>..(<span class="ident">offset</span> <span class="op">+</span> <span class="ident">size</span>) <span class="kw">as</span> <span class="ident">usize</span>]);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_to_end</span>(<span class="kw-2">&mut</span> <span class="ident">data</span>).<span class="ident">expect</span>(<span class="string">"Failed to read file data"</span>);
|
||||||
|
<span class="ident">FarFile</span> {
|
||||||
|
<span class="ident">name</span>,
|
||||||
|
<span class="ident">size</span>,
|
||||||
|
<span class="ident">data</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Creates a new FarFile struct from a size, and data buffer.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // buffer is a Vec<u8> containing the contents of a file</span>
|
||||||
|
<span class="doccomment">/// // file_name is the name of the file</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib::FarFile;</span>
|
||||||
|
<span class="doccomment">/// let file = FarFile::new_from_file(file_name, buffer.len() as u32, buffer);</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_from_file</span>(<span class="ident">name</span> : <span class="ident">String</span>, <span class="ident">size</span> : <span class="ident">u32</span>, <span class="ident">data</span> : <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) -> <span class="ident">FarFile</span> {
|
||||||
|
<span class="ident">FarFile</span> {
|
||||||
|
<span class="ident">name</span>,
|
||||||
|
<span class="ident">size</span>,
|
||||||
|
<span class="ident">data</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">impl</span> <span class="ident">FarArchive</span> {
|
||||||
|
<span class="doccomment">/// Creates a new FarArchive struct from a list of FarFile structs.</span>
|
||||||
|
<span class="doccomment">/// Important when creating a new archive.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // file_names is a Vec<String> containing the names of the files</span>
|
||||||
|
<span class="doccomment">/// use std::fs;</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib;</span>
|
||||||
|
<span class="doccomment">/// let mut file_list = Vec::new();</span>
|
||||||
|
<span class="doccomment">/// for file in file_names {</span>
|
||||||
|
<span class="doccomment">/// let file_name = file.split("/").last().unwrap();</span>
|
||||||
|
<span class="doccomment">/// let file_size = fs::metadata(file.clone()).expect("Failed to get file size").len();</span>
|
||||||
|
<span class="doccomment">/// let file_data = fs::read(file.clone()).expect("Failed to read file");</span>
|
||||||
|
<span class="doccomment">/// let file_obj = farlib::FarFile {</span>
|
||||||
|
<span class="doccomment">/// name: file_name.to_string(),</span>
|
||||||
|
<span class="doccomment">/// size: file_size as u32,</span>
|
||||||
|
<span class="doccomment">/// data: file_data</span>
|
||||||
|
<span class="doccomment">/// };</span>
|
||||||
|
<span class="doccomment">/// file_list.push(file_obj);</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// let archive = farlib::FarArchive::new_from_files(file_list);</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new_from_files</span>(<span class="ident">files</span> : <span class="ident">Vec</span><span class="op"><</span><span class="ident">FarFile</span><span class="op">></span>) -> <span class="ident">FarArchive</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_list</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_data</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">offset</span> <span class="op">=</span> <span class="number">0</span>;
|
||||||
|
<span class="kw">for</span> <span class="ident">file</span> <span class="kw">in</span> <span class="ident">files</span> {
|
||||||
|
<span class="ident">offset</span> <span class="op">+</span><span class="op">=</span> <span class="kw-2">&</span><span class="ident">file</span>.<span class="ident">size</span>;
|
||||||
|
<span class="ident">file_list</span>.<span class="ident">push</span>(<span class="ident">FarFileInfo</span> {
|
||||||
|
<span class="ident">name</span>: <span class="ident">file</span>.<span class="ident">name</span>.<span class="ident">clone</span>(),
|
||||||
|
<span class="ident">size</span>: <span class="ident">file</span>.<span class="ident">size</span>,
|
||||||
|
<span class="ident">offset</span>,
|
||||||
|
});
|
||||||
|
<span class="ident">file_data</span>.<span class="ident">push</span>(<span class="ident">file</span>);
|
||||||
|
}
|
||||||
|
<span class="ident">FarArchive</span> {
|
||||||
|
<span class="ident">version</span>: <span class="number">1</span>,
|
||||||
|
<span class="ident">file_count</span>: <span class="ident">file_list</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>,
|
||||||
|
<span class="ident">file_list</span>,
|
||||||
|
<span class="ident">file_data</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Loads file data into a FarArchive struct, used if a FarFileInfo struct is not sufficient.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // buffer is a Vec<u8> containing the contents of a .far file</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib;</span>
|
||||||
|
<span class="doccomment">/// let test = farlib::test(&buffer);</span>
|
||||||
|
<span class="doccomment">/// match test {</span>
|
||||||
|
<span class="doccomment">/// Ok(archive) => {</span>
|
||||||
|
<span class="doccomment">/// let archive = archive.load_file_data(&buffer);</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">/// Err(e) => {</span>
|
||||||
|
<span class="doccomment">/// println!("{} is not a valid archive: {}", archive_name, e);</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">load_file_data</span>(<span class="self">self</span>, <span class="ident">original_file</span> : <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) -> <span class="ident">FarArchive</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_file_data</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">file_list</span>.<span class="ident">len</span>() {
|
||||||
|
<span class="ident">new_file_data</span>.<span class="ident">push</span>(<span class="ident">FarFile::new_from_archive</span>(
|
||||||
|
<span class="self">self</span>.<span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">name</span>.<span class="ident">clone</span>(),
|
||||||
|
<span class="self">self</span>.<span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">size</span>,
|
||||||
|
<span class="self">self</span>.<span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">offset</span>,
|
||||||
|
<span class="ident">original_file</span>,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
<span class="ident">FarArchive</span> {
|
||||||
|
<span class="ident">version</span>: <span class="self">self</span>.<span class="ident">version</span>,
|
||||||
|
<span class="ident">file_count</span>: <span class="self">self</span>.<span class="ident">file_count</span>,
|
||||||
|
<span class="ident">file_list</span>: <span class="self">self</span>.<span class="ident">file_list</span>,
|
||||||
|
<span class="ident">file_data</span>: <span class="ident">new_file_data</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Creates a buffer representing the contents of a FarArchive struct.</span>
|
||||||
|
<span class="doccomment">/// Can be written to a file to create a .far archive.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// // archive is a FarArchive struct</span>
|
||||||
|
<span class="doccomment">/// // archive_name is the name of the file we will write the archive to</span>
|
||||||
|
<span class="doccomment">/// use std::fs;</span>
|
||||||
|
<span class="doccomment">/// use std::io::Write;</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib;</span>
|
||||||
|
<span class="doccomment">/// let buffer = archive.to_vec();</span>
|
||||||
|
<span class="doccomment">/// let mut file = fs::File::create(archive_name.clone()).expect("Failed to create file");</span>
|
||||||
|
<span class="doccomment">/// file.write_all(&*archive_obj.to_vec()).expect("Failed to write file");</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">to_vec</span>(<span class="self">self</span>) -> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span> {
|
||||||
|
<span class="comment">// write header</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">header</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="string">"FAR!byAZ"</span>.<span class="ident">chars</span>() {
|
||||||
|
<span class="ident">header</span>.<span class="ident">push</span>(<span class="ident">c</span> <span class="kw">as</span> <span class="ident">u8</span>);
|
||||||
|
}
|
||||||
|
<span class="ident">header</span>.<span class="ident">extend</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">version</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="comment">// wait to write manifest offset until calculated later</span>
|
||||||
|
<span class="comment">// write file data</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_data</span> <span class="op">=</span> <span class="ident">Vec::new</span>(); <span class="comment">// actual data to be written to file</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_list</span> <span class="op">=</span> <span class="ident">Vec::new</span>(); <span class="comment">// file list used for making manifest later on</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bytes_written</span> <span class="op">=</span> <span class="number">16</span>; <span class="comment">// where we should start putting files</span>
|
||||||
|
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">file_data</span>.<span class="ident">len</span>() {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_data_bytes</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="ident">file_data_bytes</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">file_data</span>[<span class="ident">i</span>].<span class="ident">data</span>);
|
||||||
|
<span class="ident">file_data</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_data_bytes</span>);
|
||||||
|
<span class="ident">file_list</span>.<span class="ident">push</span>(<span class="ident">FarFileInfo</span> {
|
||||||
|
<span class="ident">name</span>: <span class="self">self</span>.<span class="ident">file_data</span>[<span class="ident">i</span>].<span class="ident">name</span>.<span class="ident">clone</span>(),
|
||||||
|
<span class="ident">size</span>: <span class="self">self</span>.<span class="ident">file_data</span>[<span class="ident">i</span>].<span class="ident">size</span>,
|
||||||
|
<span class="ident">offset</span>: <span class="ident">bytes_written</span>,
|
||||||
|
});
|
||||||
|
<span class="ident">bytes_written</span> <span class="op">+</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">file_data</span>[<span class="ident">i</span>].<span class="ident">size</span>;
|
||||||
|
}
|
||||||
|
<span class="comment">// write manifest</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">manifest</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="comment">// write file count</span>
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">file_count</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="comment">// for each file, write (size, size, offset, name length, name)</span>
|
||||||
|
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">file_list</span>.<span class="ident">len</span>() {
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">size</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">size</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">offset</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span>(<span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">name</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>).<span class="ident">to_le_bytes</span>());
|
||||||
|
<span class="ident">manifest</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_list</span>[<span class="ident">i</span>].<span class="ident">name</span>.<span class="ident">as_bytes</span>());
|
||||||
|
}
|
||||||
|
<span class="comment">// write manifest offset</span>
|
||||||
|
<span class="kw">let</span> <span class="ident">manifest_offset</span> <span class="op">=</span> <span class="ident">bytes_written</span>;
|
||||||
|
<span class="ident">header</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">manifest_offset</span>.<span class="ident">to_le_bytes</span>());
|
||||||
|
|
||||||
|
<span class="comment">// join vecs together</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">output</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="ident">output</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">header</span>);
|
||||||
|
<span class="ident">output</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">file_data</span>);
|
||||||
|
<span class="ident">output</span>.<span class="ident">extend_from_slice</span>(<span class="kw-2">&</span><span class="ident">manifest</span>);
|
||||||
|
<span class="ident">output</span>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Tests if a buffer is a valid FarArchive.</span>
|
||||||
|
<span class="doccomment">/// Returns a FarArchive struct if it is, or an error if it is not.</span>
|
||||||
|
<span class="doccomment">///</span>
|
||||||
|
<span class="doccomment">/// # Examples</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="doccomment">/// use std::fs;</span>
|
||||||
|
<span class="doccomment">/// use libfar::farlib;</span>
|
||||||
|
<span class="doccomment">/// let buffer = fs::read("test.far").expect("Failed to read file");</span>
|
||||||
|
<span class="doccomment">/// let test = farlib::test(&buffer);</span>
|
||||||
|
<span class="doccomment">/// match test {</span>
|
||||||
|
<span class="doccomment">/// Ok(archive) => {</span>
|
||||||
|
<span class="doccomment">/// println!("test.far is a valid archive");</span>
|
||||||
|
<span class="doccomment">/// },</span>
|
||||||
|
<span class="doccomment">/// Err(e) => {</span>
|
||||||
|
<span class="doccomment">/// println!("test.far is not a valid archive: {}", e);</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">/// }</span>
|
||||||
|
<span class="doccomment">/// ```</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">test</span>(<span class="ident">file</span> : <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">FarArchive</span>, <span class="ident">String</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">BufReader::new</span>(<span class="kw-2">&</span><span class="ident">file</span>[..]);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">magic</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">8</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">magic</span>).<span class="ident">unwrap</span>();
|
||||||
|
<span class="kw">if</span> <span class="ident">magic</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">*</span><span class="string">b"FAR!byAZ"</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">"Not a Far archive"</span>.<span class="ident">to_string</span>());
|
||||||
|
}
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">version</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">version</span>).<span class="ident">unwrap</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">version</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">version</span>);
|
||||||
|
<span class="comment">// get list of files</span>
|
||||||
|
<span class="kw">let</span> <span class="ident">files</span> <span class="op">=</span> <span class="ident">list_files</span>(<span class="ident">file</span>).<span class="ident">expect</span>(<span class="string">"Failed to list files"</span>);
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">FarArchive</span> {
|
||||||
|
<span class="ident">version</span>,
|
||||||
|
<span class="ident">file_count</span>: <span class="ident">files</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>,
|
||||||
|
<span class="ident">file_list</span>: <span class="ident">files</span>,
|
||||||
|
<span class="ident">file_data</span>: <span class="macro">vec!</span>[],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">list_files</span>(<span class="ident">file</span> : <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">u8</span><span class="op">></span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">FarFileInfo</span><span class="op">></span>, <span class="ident">String</span><span class="op">></span> {
|
||||||
|
<span class="comment">// manifest offset is at 12 bytes (u32)</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">BufReader::new</span>(<span class="kw-2">&</span><span class="ident">file</span>[<span class="number">12</span>..]);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">offset</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">offset</span>).<span class="ident">unwrap</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">offset</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">offset</span>);
|
||||||
|
<span class="comment">// move to manifest</span>
|
||||||
|
<span class="ident">reader</span> <span class="op">=</span> <span class="ident">BufReader::new</span>(<span class="kw-2">&</span><span class="ident">file</span>[<span class="ident">offset</span> <span class="kw">as</span> <span class="ident">usize</span>..]);
|
||||||
|
<span class="comment">// read u32 for number of files</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">num_files</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">num_files</span>).<span class="ident">unwrap</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">num_files</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">num_files</span>);
|
||||||
|
<span class="comment">// for each file, read u32 for size, u32 for size again (stored twice for some reason), u32 for offset, u32 for name length, name</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">files</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">num_files</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">size</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">size</span>).<span class="ident">expect</span>(<span class="macro">format!</span>(<span class="string">"Failed to read size for file {}"</span>, <span class="ident">i</span>).<span class="ident">as_str</span>());
|
||||||
|
<span class="kw">let</span> <span class="ident">size</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">size</span>);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">size2</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">size2</span>).<span class="ident">expect</span>(<span class="macro">format!</span>(<span class="string">"Failed to read size for file {}"</span>, <span class="ident">i</span>).<span class="ident">as_str</span>());
|
||||||
|
<span class="kw">let</span> <span class="ident">_size2</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">size2</span>); <span class="comment">// why is this stored twice? f*** you EA</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">offset</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">offset</span>).<span class="ident">expect</span>(<span class="macro">format!</span>(<span class="string">"Failed to read offset for file {}"</span>, <span class="ident">i</span>).<span class="ident">as_str</span>());
|
||||||
|
<span class="kw">let</span> <span class="ident">offset</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">offset</span>);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">name_len</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="number">4</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">name_len</span>).<span class="ident">expect</span>(<span class="macro">format!</span>(<span class="string">"Failed to read name length for file {}"</span>, <span class="ident">i</span>).<span class="ident">as_str</span>());
|
||||||
|
<span class="kw">let</span> <span class="ident">name_len</span> <span class="op">=</span> <span class="ident">u32::from_le_bytes</span>(<span class="ident">name_len</span>);
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">name</span> <span class="op">=</span> <span class="macro">vec!</span>[<span class="number">0u8</span>; <span class="ident">name_len</span> <span class="kw">as</span> <span class="ident">usize</span>];
|
||||||
|
<span class="ident">reader</span>.<span class="ident">read_exact</span>(<span class="kw-2">&mut</span> <span class="ident">name</span>).<span class="ident">expect</span>(<span class="macro">format!</span>(<span class="string">"Failed to read name for file {}"</span>, <span class="ident">i</span>).<span class="ident">as_str</span>());
|
||||||
|
<span class="ident">files</span>.<span class="ident">push</span>(<span class="ident">FarFileInfo</span> {
|
||||||
|
<span class="ident">name</span>: <span class="ident">String::from_utf8</span>(<span class="ident">name</span>).<span class="ident">unwrap</span>(),
|
||||||
|
<span class="ident">size</span>,
|
||||||
|
<span class="ident">offset</span>,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">files</span>)
|
||||||
|
}</code></pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
6
target/doc/src/libfar/lib.rs.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/lib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>lib.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script><script defer src="../../source-script.js"></script><script defer src="../../source-files.js"></script>
|
||||||
|
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../libfar/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
|
||||||
|
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../libfar/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1">1</span>
|
||||||
|
</pre><pre class="rust"><code><span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">farlib</span>;</code></pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="libfar" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
|
||||||
|
</body></html>
|
1
target/doc/storage.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i<length;++i){if(func(arr[i])){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function updateLocalStorage(name,value){try{window.localStorage.setItem(name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem(name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var newHref=mainStyleElem.href.replace(/\/rustdoc([^/]*)\.css/,"/"+newTheme+"$1"+".css");if(saveTheme){updateLocalStorage("rustdoc-theme",newTheme)}if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("rustdoc-use-system-theme",value);var toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}var updateSystemTheme=(function(){if(!window.matchMedia){return function(){var cssTheme=getComputedStyle(document.documentElement).getPropertyValue('content');switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}var mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){if(getSettingValue("use-system-theme")!=="false"){var lightTheme=getSettingValue("preferred-light-theme")||"light";var darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){switchTheme(window.currentTheme,window.mainTheme,darkTheme,true)}else{switchTheme(window.currentTheme,window.mainTheme,lightTheme,true)}}}mql.addListener(handlePreferenceChange);return function(){handlePreferenceChange(mql)}})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)}
|
1
target/doc/toggle-minus.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg width="17" height="17" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7"/></svg>
|
After Width: | Height: | Size: 174 B |
1
target/doc/toggle-plus.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg width="17" height="17" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg>
|
After Width: | Height: | Size: 191 B |
1
target/doc/wheel.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Capa_1" width="27.434" height="29.5" enable-background="new 0 0 27.434 29.5" version="1.1" viewBox="0 0 27.434 29.5" xml:space="preserve"><g><path d="M27.315,18.389c-0.165-0.604-0.509-1.113-0.981-1.459c-0.042-0.144-0.083-0.429-0.015-0.761l0.037-0.177v-0.182V14.8 c0-1.247-0.006-1.277-0.048-1.472c-0.076-0.354-0.035-0.653,0.007-0.803c0.477-0.346,0.828-0.861,0.996-1.476 c0.261-0.956,0.076-2.091-0.508-3.114l-0.591-1.032c-0.746-1.307-1.965-2.119-3.182-2.119c-0.378,0-0.75,0.081-1.085,0.235 c-0.198-0.025-0.554-0.15-0.855-0.389l-0.103-0.082l-0.114-0.065l-1.857-1.067L18.92,3.36l-0.105-0.044 c-0.376-0.154-0.658-0.41-0.768-0.556C17.918,1.172,16.349,0,14.296,0H13.14c-2.043,0-3.608,1.154-3.749,2.721 C9.277,2.862,8.999,3.104,8.633,3.25l-0.1,0.039L8.439,3.341L6.495,4.406L6.363,4.479L6.245,4.573 C5.936,4.82,5.596,4.944,5.416,4.977c-0.314-0.139-0.66-0.21-1.011-0.21c-1.198,0-2.411,0.819-3.165,2.139L0.65,7.938 c-0.412,0.72-0.642,1.521-0.644,2.258c-0.003,0.952,0.362,1.756,1.013,2.256c0.034,0.155,0.061,0.448-0.016,0.786 c-0.038,0.168-0.062,0.28-0.062,1.563c0,1.148,0,1.148,0.015,1.262l0.009,0.073l0.017,0.073c0.073,0.346,0.045,0.643,0.011,0.802 C0.348,17.512-0.01,18.314,0,19.268c0.008,0.729,0.238,1.523,0.648,2.242l0.589,1.031c0.761,1.331,1.967,2.159,3.15,2.159 c0.324,0,0.645-0.064,0.938-0.187c0.167,0.038,0.492,0.156,0.813,0.416l0.11,0.088l0.124,0.07l2.045,1.156l0.102,0.057l0.107,0.043 c0.364,0.147,0.646,0.381,0.766,0.521c0.164,1.52,1.719,2.634,3.745,2.634h1.155c2.037,0,3.598-1.134,3.747-2.675 c0.117-0.145,0.401-0.393,0.774-0.549l0.111-0.047l0.105-0.062l1.96-1.159l0.105-0.062l0.097-0.075 c0.309-0.246,0.651-0.371,0.832-0.402c0.313,0.138,0.662,0.212,1.016,0.212c1.199,0,2.412-0.82,3.166-2.139l0.59-1.032 C27.387,20.48,27.575,19.342,27.315,18.389z M25.274,20.635l-0.59,1.032c-0.438,0.765-1.104,1.251-1.639,1.251 c-0.133,0-0.258-0.029-0.369-0.094c-0.15-0.086-0.346-0.127-0.566-0.127c-0.596,0-1.383,0.295-2.01,0.796l-1.96,1.157 c-1.016,0.425-1.846,1.291-1.846,1.929s-0.898,1.159-1.998,1.159H13.14c-1.1,0-1.998-0.514-1.998-1.141s-0.834-1.477-1.854-1.888 l-2.046-1.157c-0.636-0.511-1.425-0.814-2.006-0.814c-0.202,0-0.379,0.037-0.516,0.115c-0.101,0.057-0.214,0.084-0.333,0.084 c-0.518,0-1.179-0.498-1.62-1.271l-0.591-1.032c-0.545-0.954-0.556-1.983-0.024-2.286c0.532-0.305,0.78-1.432,0.551-2.506 c0,0,0-0.003,0-1.042c0-1.088,0.021-1.18,0.021-1.18c0.238-1.072-0.01-2.203-0.552-2.513C1.631,10.8,1.634,9.765,2.18,8.812 L2.769,7.78c0.438-0.766,1.103-1.251,1.636-1.251c0.131,0,0.255,0.029,0.365,0.092C4.92,6.707,5.114,6.747,5.334,6.747 c0.596,0,1.38-0.296,2.007-0.795l1.944-1.065c1.021-0.407,1.856-1.277,1.856-1.933c0-0.656,0.898-1.192,1.998-1.192h1.156V1.761 c1.1,0,1.998,0.545,1.998,1.211c0,0.667,0.832,1.554,1.849,1.973L20,6.013c0.618,0.489,1.401,0.775,2.012,0.775 c0.24,0,0.454-0.045,0.62-0.139c0.122-0.069,0.259-0.102,0.403-0.102c0.551,0,1.221,0.476,1.653,1.231l0.59,1.032 c0.544,0.953,0.518,2.004-0.062,2.334c-0.577,0.331-0.859,1.48-0.627,2.554c0,0,0.01,0.042,0.01,1.103c0,1.012,0,1.012,0,1.012 c-0.218,1.049,0.068,2.174,0.636,2.498C25.802,18.635,25.819,19.68,25.274,20.635z"/><path d="M13.61,7.611c-3.913,0-7.084,3.173-7.084,7.085c0,3.914,3.171,7.085,7.084,7.085s7.085-3.172,7.085-7.085 C20.695,10.784,17.523,7.611,13.61,7.611z M13.61,20.02c-2.936,0-5.323-2.388-5.323-5.323c0-2.935,2.388-5.323,5.323-5.323 s5.324,2.388,5.324,5.323C18.934,17.632,16.546,20.02,13.61,20.02z"/><path d="M13.682,9.908c-2.602,0-4.718,2.116-4.718,4.718c0,2.601,2.116,4.716,4.718,4.716c2.601,0,4.717-2.115,4.717-4.716 C18.399,12.024,16.283,9.908,13.682,9.908z M13.682,17.581c-1.633,0-2.956-1.323-2.956-2.955s1.323-2.956,2.956-2.956 c1.632,0,2.956,1.324,2.956,2.956S15.314,17.581,13.682,17.581z"/></g></svg>
|
After Width: | Height: | Size: 3.7 KiB |