diff --git a/.gitignore b/.gitignore index 96ef6c0..f5aee01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ -/target +/target/debug +/target/package +/target/release +/target/.rustc_info.json +/target/.rustdoc_fingerprint.json +/target/CACHEDIR.TAG Cargo.lock diff --git a/target/doc/.lock b/target/doc/.lock new file mode 100755 index 0000000..e69de29 diff --git a/target/doc/COPYRIGHT.txt b/target/doc/COPYRIGHT.txt new file mode 100644 index 0000000..c2629a8 --- /dev/null +++ b/target/doc/COPYRIGHT.txt @@ -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. diff --git a/target/doc/FiraSans-LICENSE.txt b/target/doc/FiraSans-LICENSE.txt new file mode 100644 index 0000000..ff9afab --- /dev/null +++ b/target/doc/FiraSans-LICENSE.txt @@ -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. diff --git a/target/doc/FiraSans-Medium.woff b/target/doc/FiraSans-Medium.woff new file mode 100644 index 0000000..7d742c5 Binary files /dev/null and b/target/doc/FiraSans-Medium.woff differ diff --git a/target/doc/FiraSans-Medium.woff2 b/target/doc/FiraSans-Medium.woff2 new file mode 100644 index 0000000..7a1e5fc Binary files /dev/null and b/target/doc/FiraSans-Medium.woff2 differ diff --git a/target/doc/FiraSans-Regular.woff b/target/doc/FiraSans-Regular.woff new file mode 100644 index 0000000..d8e0363 Binary files /dev/null and b/target/doc/FiraSans-Regular.woff differ diff --git a/target/doc/FiraSans-Regular.woff2 b/target/doc/FiraSans-Regular.woff2 new file mode 100644 index 0000000..e766e06 Binary files /dev/null and b/target/doc/FiraSans-Regular.woff2 differ diff --git a/target/doc/LICENSE-APACHE.txt b/target/doc/LICENSE-APACHE.txt new file mode 100644 index 0000000..16fe87b --- /dev/null +++ b/target/doc/LICENSE-APACHE.txt @@ -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. diff --git a/target/doc/LICENSE-MIT.txt b/target/doc/LICENSE-MIT.txt new file mode 100644 index 0000000..31aa793 --- /dev/null +++ b/target/doc/LICENSE-MIT.txt @@ -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. diff --git a/target/doc/NanumBarunGothic-LICENSE.txt b/target/doc/NanumBarunGothic-LICENSE.txt new file mode 100644 index 0000000..0bf4668 --- /dev/null +++ b/target/doc/NanumBarunGothic-LICENSE.txt @@ -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. diff --git a/target/doc/NanumBarunGothic.ttf.woff b/target/doc/NanumBarunGothic.ttf.woff new file mode 100644 index 0000000..fb063e8 Binary files /dev/null and b/target/doc/NanumBarunGothic.ttf.woff differ diff --git a/target/doc/NanumBarunGothic.ttf.woff2 b/target/doc/NanumBarunGothic.ttf.woff2 new file mode 100644 index 0000000..1866ad4 Binary files /dev/null and b/target/doc/NanumBarunGothic.ttf.woff2 differ diff --git a/target/doc/SourceCodePro-It.ttf.woff b/target/doc/SourceCodePro-It.ttf.woff new file mode 100644 index 0000000..8d68f2f Binary files /dev/null and b/target/doc/SourceCodePro-It.ttf.woff differ diff --git a/target/doc/SourceCodePro-It.ttf.woff2 b/target/doc/SourceCodePro-It.ttf.woff2 new file mode 100644 index 0000000..462c34e Binary files /dev/null and b/target/doc/SourceCodePro-It.ttf.woff2 differ diff --git a/target/doc/SourceCodePro-LICENSE.txt b/target/doc/SourceCodePro-LICENSE.txt new file mode 100644 index 0000000..0754257 --- /dev/null +++ b/target/doc/SourceCodePro-LICENSE.txt @@ -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. diff --git a/target/doc/SourceCodePro-Regular.ttf.woff b/target/doc/SourceCodePro-Regular.ttf.woff new file mode 100644 index 0000000..7be076e Binary files /dev/null and b/target/doc/SourceCodePro-Regular.ttf.woff differ diff --git a/target/doc/SourceCodePro-Regular.ttf.woff2 b/target/doc/SourceCodePro-Regular.ttf.woff2 new file mode 100644 index 0000000..10b558e Binary files /dev/null and b/target/doc/SourceCodePro-Regular.ttf.woff2 differ diff --git a/target/doc/SourceCodePro-Semibold.ttf.woff b/target/doc/SourceCodePro-Semibold.ttf.woff new file mode 100644 index 0000000..61bc67b Binary files /dev/null and b/target/doc/SourceCodePro-Semibold.ttf.woff differ diff --git a/target/doc/SourceCodePro-Semibold.ttf.woff2 b/target/doc/SourceCodePro-Semibold.ttf.woff2 new file mode 100644 index 0000000..5ec64ee Binary files /dev/null and b/target/doc/SourceCodePro-Semibold.ttf.woff2 differ diff --git a/target/doc/SourceSerif4-Bold.ttf.woff b/target/doc/SourceSerif4-Bold.ttf.woff new file mode 100644 index 0000000..8ad4188 Binary files /dev/null and b/target/doc/SourceSerif4-Bold.ttf.woff differ diff --git a/target/doc/SourceSerif4-Bold.ttf.woff2 b/target/doc/SourceSerif4-Bold.ttf.woff2 new file mode 100644 index 0000000..db57d21 Binary files /dev/null and b/target/doc/SourceSerif4-Bold.ttf.woff2 differ diff --git a/target/doc/SourceSerif4-It.ttf.woff b/target/doc/SourceSerif4-It.ttf.woff new file mode 100644 index 0000000..2a34b5c Binary files /dev/null and b/target/doc/SourceSerif4-It.ttf.woff differ diff --git a/target/doc/SourceSerif4-It.ttf.woff2 b/target/doc/SourceSerif4-It.ttf.woff2 new file mode 100644 index 0000000..1cbc021 Binary files /dev/null and b/target/doc/SourceSerif4-It.ttf.woff2 differ diff --git a/target/doc/SourceSerif4-LICENSE.md b/target/doc/SourceSerif4-LICENSE.md new file mode 100644 index 0000000..68ea189 --- /dev/null +++ b/target/doc/SourceSerif4-LICENSE.md @@ -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. diff --git a/target/doc/SourceSerif4-Regular.ttf.woff b/target/doc/SourceSerif4-Regular.ttf.woff new file mode 100644 index 0000000..45a5521 Binary files /dev/null and b/target/doc/SourceSerif4-Regular.ttf.woff differ diff --git a/target/doc/SourceSerif4-Regular.ttf.woff2 b/target/doc/SourceSerif4-Regular.ttf.woff2 new file mode 100644 index 0000000..2db73fe Binary files /dev/null and b/target/doc/SourceSerif4-Regular.ttf.woff2 differ diff --git a/target/doc/ayu.css b/target/doc/ayu.css new file mode 100644 index 0000000..5122904 --- /dev/null +++ b/target/doc/ayu.css @@ -0,0 +1 @@ + body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 #24292f;}.sidebar{scrollbar-color:#5c6773 #24292f;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#14191f;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#5c6773;}.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ffa0a5;}.content span.union,.content a.union{color:#ffa0a5;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#39AFD7;}.content span.primitive,.content a.primitive{color:#ffa0a5;}.content span.traitalias,.content a.traitalias{color:#39AFD7;}.content span.keyword,.content a.keyword{color:#39AFD7;}.content span.externcrate,.content span.mod,.content a.mod{color:#39AFD7;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#ffa0a5;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#39AFD7;}.content span.type,.content a.type,.block a.current.type{color:#39AFD7;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#39AFD7;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#39AFD7;}a.srclink,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar a,.in-band a{color:#c5c5c5;}.search-results a{color:#0096cf;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help span.bottom,#help span.top{border-color:#5c6773;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.typedef,.content a.typedef,.block a.current.typedef{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-associatedtype:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(15,20,25,1),rgba(15,20,25,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(15,20,25,1),rgba(15,20,25,0));}.toggle-line-inner{background:#616161;}.toggle-line:hover .toggle-line-inner{background:##898989;} \ No newline at end of file diff --git a/target/doc/brush.svg b/target/doc/brush.svg new file mode 100644 index 0000000..ea266e8 --- /dev/null +++ b/target/doc/brush.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/target/doc/clipboard.svg b/target/doc/clipboard.svg new file mode 100644 index 0000000..8adbd99 --- /dev/null +++ b/target/doc/clipboard.svg @@ -0,0 +1 @@ + diff --git a/target/doc/crates.js b/target/doc/crates.js new file mode 100644 index 0000000..4507fe6 --- /dev/null +++ b/target/doc/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["libfar"]; \ No newline at end of file diff --git a/target/doc/dark.css b/target/doc/dark.css new file mode 100644 index 0000000..159f551 --- /dev/null +++ b/target/doc/dark.css @@ -0,0 +1 @@ +body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) #5a5a5a;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#565656;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#884719;}a.result-enum:focus{background-color:#194e9f;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#194e9f;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#194e9f;}a.result-associatedtype:focus{background-color:#884719;}a.result-foreigntype:focus{background-color:#194e9f;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#884719;}a.result-primitive:focus{background-color:#194e9f;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#2dbfb8;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#2dbfb8;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#D2991D;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#2dbfb8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#2dbfb8;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#D2991D;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2dbfb8;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#D2991D;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b78cf2;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#D2991D;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#D2991D;}a.srclink,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar a,.in-band a{color:#ddd;}.search-results a{color:#ddd;}a.test-arrow{color:#dedede;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target{background-color:#494a3d;border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(53,53,53,1),rgba(53,53,53,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(53,53,53,1),rgba(53,53,53,0));}.toggle-line-inner{background:#616161;}.toggle-line:hover .toggle-line-inner{background:##898989;} \ No newline at end of file diff --git a/target/doc/down-arrow.svg b/target/doc/down-arrow.svg new file mode 100644 index 0000000..35437e7 --- /dev/null +++ b/target/doc/down-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/target/doc/favicon-16x16.png b/target/doc/favicon-16x16.png new file mode 100644 index 0000000..7cfe6c1 Binary files /dev/null and b/target/doc/favicon-16x16.png differ diff --git a/target/doc/favicon-32x32.png b/target/doc/favicon-32x32.png new file mode 100644 index 0000000..5109c1d Binary files /dev/null and b/target/doc/favicon-32x32.png differ diff --git a/target/doc/favicon.svg b/target/doc/favicon.svg new file mode 100644 index 0000000..8b34b51 --- /dev/null +++ b/target/doc/favicon.svg @@ -0,0 +1,24 @@ + diff --git a/target/doc/implementors/core/marker/trait.Freeze.js b/target/doc/implementors/core/marker/trait.Freeze.js new file mode 100644 index 0000000..e613950 --- /dev/null +++ b/target/doc/implementors/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl Freeze for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl Freeze for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl Freeze for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/implementors/core/marker/trait.Send.js b/target/doc/implementors/core/marker/trait.Send.js new file mode 100644 index 0000000..5837551 --- /dev/null +++ b/target/doc/implementors/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl Send for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl Send for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl Send for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/implementors/core/marker/trait.Sync.js b/target/doc/implementors/core/marker/trait.Sync.js new file mode 100644 index 0000000..1eb0ab0 --- /dev/null +++ b/target/doc/implementors/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl Sync for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl Sync for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl Sync for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/implementors/core/marker/trait.Unpin.js b/target/doc/implementors/core/marker/trait.Unpin.js new file mode 100644 index 0000000..3517e9e --- /dev/null +++ b/target/doc/implementors/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl Unpin for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl Unpin for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl Unpin for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/target/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000..c39c9a0 --- /dev/null +++ b/target/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl RefUnwindSafe for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl RefUnwindSafe for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl RefUnwindSafe for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/target/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000..ee784e7 --- /dev/null +++ b/target/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["libfar"] = [{"text":"impl UnwindSafe for FarFileInfo","synthetic":true,"types":["libfar::farlib::FarFileInfo"]},{"text":"impl UnwindSafe for FarFile","synthetic":true,"types":["libfar::farlib::FarFile"]},{"text":"impl UnwindSafe for FarArchive","synthetic":true,"types":["libfar::farlib::FarArchive"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/target/doc/libfar/all.html b/target/doc/libfar/all.html new file mode 100644 index 0000000..c227436 --- /dev/null +++ b/target/doc/libfar/all.html @@ -0,0 +1,6 @@ +
pub fn test(file: &Vec<u8>) -> Result<FarArchive, String>
Tests if a buffer is a valid FarArchive. +Returns a FarArchive struct if it is, or an error if it is not.
+use std::fs;
+use libfar::farlib;
+let buffer = fs::read("test.far").expect("Failed to read file");
+let test = farlib::test(&buffer);
+match test {
+ Ok(archive) => {
+ println!("test.far is a valid archive");
+ },
+ Err(e) => {
+ println!("test.far is not a valid archive: {}", e);
+ }
+}
Struct containing information about an archive.
+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.
+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).
+Tests if a buffer is a valid FarArchive. +Returns a FarArchive struct if it is, or an error if it is not.
+pub struct FarArchive {
+ pub version: u32,
+ pub file_count: u32,
+ pub file_list: Vec<FarFileInfo>,
+ pub file_data: Vec<FarFile>,
+}
Struct containing information about an archive.
+Should be created by one of two ways:
+FarArchive::new_from_files
if creating an archive from a list of FarFile structsfarlib::test(buffer)
if loading an archive from a file/bufferversion: u32
file_count: u32
file_list: Vec<FarFileInfo>
file_data: Vec<FarFile>
Creates a new FarArchive struct from a list of FarFile structs. +Important when creating a new archive.
+// file_names is a Vec<String> containing the names of the files
+use std::fs;
+use libfar::farlib;
+let mut file_list = Vec::new();
+for file in file_names {
+ let file_name = file.split("/").last().unwrap();
+ let file_size = fs::metadata(file.clone()).expect("Failed to get file size").len();
+ let file_data = fs::read(file.clone()).expect("Failed to read file");
+ let file_obj = farlib::FarFile {
+ name: file_name.to_string(),
+ size: file_size as u32,
+ data: file_data
+ };
+ file_list.push(file_obj);
+}
+
+let archive = farlib::FarArchive::new_from_files(file_list);
Loads file data into a FarArchive struct, used if a FarFileInfo struct is not sufficient.
+// buffer is a Vec<u8> containing the contents of a .far file
+use libfar::farlib;
+let test = farlib::test(&buffer);
+match test {
+ Ok(archive) => {
+ let archive = archive.load_file_data(&buffer);
+ }
+ Err(e) => {
+ println!("{} is not a valid archive: {}", archive_name, e);
+ }
+}
Creates a buffer representing the contents of a FarArchive struct. +Can be written to a file to create a .far archive.
+// archive is a FarArchive struct
+// archive_name is the name of the file we will write the archive to
+use std::fs;
+use std::io::Write;
+use libfar::farlib;
+let buffer = archive.to_vec();
+let mut file = fs::File::create(archive_name.clone()).expect("Failed to create file");
+file.write_all(&*archive_obj.to_vec()).expect("Failed to write file");
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.
+Should be created by calling FarFile::new_from_archive
if extracting from an archive, or
+FarFile::new_from_file
if reading from a buffer.
// buffer is a Vec<u8> containing the contents of a file
+// fileA_name is the name of the file
+use libfar::farlib::FarFile;
+let fileA = FarFile::new_from_file(fileA_name, buffer.len() as u32, buffer);
+
+// archive_buf is a Vec<u8> containing the contents of a .far file
+// fileB_name is the name of the file that we got from reading the manifest
+// fileB_size is the size of the file that we got from reading the manifest
+// fileB_offset is the offset of the file that we got from reading the manifest
+let fileB = FarFile::new_from_archive(fileB_name, fileB_size, fileB_offset, archive_buf);
name: String
size: u32
data: Vec<u8>
Creates a new FarFile struct from an offset, size, and archive buffer.
+// archive_buf is a Vec<u8> containing the contents of a .far file
+// file_name is the name of the file that we got from reading the manifest
+// file_size is the size of the file that we got from reading the manifest
+// file_offset is the offset of the file that we got from reading the manifest
+use libfar::farlib::FarFile;
+let file = FarFile::new_from_archive(file_name, file_size, file_offset, archive_buf);
Creates a new FarFile struct from a size, and data buffer.
+// buffer is a Vec<u8> containing the contents of a file
+// file_name is the name of the file
+use libfar::farlib::FarFile;
+let file = FarFile::new_from_file(file_name, buffer.len() as u32, buffer);
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).
+name: String
size: u32
fn:
) to \
+ restrict the search to a given item kind.","Accepted kinds are: fn
, mod
, struct
, \
+ enum
, trait
, type
, macro
, \
+ and const
.","Search functions by type signature (e.g., vec -> usize
or \
+ * -> vec
)","Search multiple things at once by splitting your query with comma (e.g., \
+ str,u8
or String,struct:Vec,test
)","You can look for items with an exact name by putting double quotes around \
+ your request: \"string\"
","Look for items inside another one by searching for a path: vec::Vec
",].map(function(x){return""+x+"
"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +
use std::io::{BufReader, Read};
+
+/// 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).
+pub struct FarFileInfo {
+ pub name: String,
+ pub size: u32,
+ offset: u32,
+}
+
+/// 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.
+///
+/// Should be created by calling `FarFile::new_from_archive` if extracting from an archive, or
+/// `FarFile::new_from_file` if reading from a buffer.
+///
+/// # Examples
+/// ```
+/// // buffer is a Vec<u8> containing the contents of a file
+/// // fileA_name is the name of the file
+/// use libfar::farlib::FarFile;
+/// let fileA = FarFile::new_from_file(fileA_name, buffer.len() as u32, buffer);
+///
+/// // archive_buf is a Vec<u8> containing the contents of a .far file
+/// // fileB_name is the name of the file that we got from reading the manifest
+/// // fileB_size is the size of the file that we got from reading the manifest
+/// // fileB_offset is the offset of the file that we got from reading the manifest
+/// let fileB = FarFile::new_from_archive(fileB_name, fileB_size, fileB_offset, archive_buf);
+/// ```
+pub struct FarFile {
+ pub name: String,
+ pub size: u32,
+ pub data: Vec<u8>,
+}
+
+/// Struct containing information about an archive.
+///
+/// Should be created by one of two ways:
+/// 1. Calling `FarArchive::new_from_files` if creating an archive from a list of FarFile structs
+/// 2. Calling `farlib::test(buffer)` if loading an archive from a file/buffer
+pub struct FarArchive {
+ pub version: u32,
+ pub file_count: u32,
+ pub file_list: Vec<FarFileInfo>,
+ pub file_data: Vec<FarFile>,
+}
+
+impl FarFile {
+ /// Creates a new FarFile struct from an offset, size, and archive buffer.
+ ///
+ /// # Examples
+ /// ```
+ /// // archive_buf is a Vec<u8> containing the contents of a .far file
+ /// // file_name is the name of the file that we got from reading the manifest
+ /// // file_size is the size of the file that we got from reading the manifest
+ /// // file_offset is the offset of the file that we got from reading the manifest
+ /// use libfar::farlib::FarFile;
+ /// let file = FarFile::new_from_archive(file_name, file_size, file_offset, archive_buf);
+ /// ```
+ pub fn new_from_archive(name : String, size : u32, offset : u32, original_file : &Vec<u8>) -> FarFile {
+ let mut reader = BufReader::new(&original_file[offset as usize..(offset + size) as usize]);
+ let mut data = Vec::new();
+ reader.read_to_end(&mut data).expect("Failed to read file data");
+ FarFile {
+ name,
+ size,
+ data,
+ }
+ }
+
+ /// Creates a new FarFile struct from a size, and data buffer.
+ ///
+ /// # Examples
+ /// ```
+ /// // buffer is a Vec<u8> containing the contents of a file
+ /// // file_name is the name of the file
+ /// use libfar::farlib::FarFile;
+ /// let file = FarFile::new_from_file(file_name, buffer.len() as u32, buffer);
+ /// ```
+ pub fn new_from_file(name : String, size : u32, data : Vec<u8>) -> FarFile {
+ FarFile {
+ name,
+ size,
+ data,
+ }
+ }
+}
+
+impl FarArchive {
+ /// Creates a new FarArchive struct from a list of FarFile structs.
+ /// Important when creating a new archive.
+ ///
+ /// # Examples
+ /// ```
+ /// // file_names is a Vec<String> containing the names of the files
+ /// use std::fs;
+ /// use libfar::farlib;
+ /// let mut file_list = Vec::new();
+ /// for file in file_names {
+ /// let file_name = file.split("/").last().unwrap();
+ /// let file_size = fs::metadata(file.clone()).expect("Failed to get file size").len();
+ /// let file_data = fs::read(file.clone()).expect("Failed to read file");
+ /// let file_obj = farlib::FarFile {
+ /// name: file_name.to_string(),
+ /// size: file_size as u32,
+ /// data: file_data
+ /// };
+ /// file_list.push(file_obj);
+ /// }
+ ///
+ /// let archive = farlib::FarArchive::new_from_files(file_list);
+ /// ```
+ pub fn new_from_files(files : Vec<FarFile>) -> FarArchive {
+ let mut file_list = Vec::new();
+ let mut file_data = Vec::new();
+ let mut offset = 0;
+ for file in files {
+ offset += &file.size;
+ file_list.push(FarFileInfo {
+ name: file.name.clone(),
+ size: file.size,
+ offset,
+ });
+ file_data.push(file);
+ }
+ FarArchive {
+ version: 1,
+ file_count: file_list.len() as u32,
+ file_list,
+ file_data,
+ }
+ }
+
+ /// Loads file data into a FarArchive struct, used if a FarFileInfo struct is not sufficient.
+ ///
+ /// # Examples
+ /// ```
+ /// // buffer is a Vec<u8> containing the contents of a .far file
+ /// use libfar::farlib;
+ /// let test = farlib::test(&buffer);
+ /// match test {
+ /// Ok(archive) => {
+ /// let archive = archive.load_file_data(&buffer);
+ /// }
+ /// Err(e) => {
+ /// println!("{} is not a valid archive: {}", archive_name, e);
+ /// }
+ /// }
+ /// ```
+ pub fn load_file_data(self, original_file : &Vec<u8>) -> FarArchive {
+ let mut new_file_data = Vec::new();
+ for i in 0..self.file_list.len() {
+ new_file_data.push(FarFile::new_from_archive(
+ self.file_list[i].name.clone(),
+ self.file_list[i].size,
+ self.file_list[i].offset,
+ original_file,
+ ));
+ }
+ FarArchive {
+ version: self.version,
+ file_count: self.file_count,
+ file_list: self.file_list,
+ file_data: new_file_data,
+ }
+ }
+
+ /// Creates a buffer representing the contents of a FarArchive struct.
+ /// Can be written to a file to create a .far archive.
+ ///
+ /// # Examples
+ /// ```
+ /// // archive is a FarArchive struct
+ /// // archive_name is the name of the file we will write the archive to
+ /// use std::fs;
+ /// use std::io::Write;
+ /// use libfar::farlib;
+ /// let buffer = archive.to_vec();
+ /// let mut file = fs::File::create(archive_name.clone()).expect("Failed to create file");
+ /// file.write_all(&*archive_obj.to_vec()).expect("Failed to write file");
+ /// ```
+ pub fn to_vec(self) -> Vec<u8> {
+ // write header
+ let mut header = Vec::new();
+ for c in "FAR!byAZ".chars() {
+ header.push(c as u8);
+ }
+ header.extend(&self.version.to_le_bytes());
+ // wait to write manifest offset until calculated later
+ // write file data
+ let mut file_data = Vec::new(); // actual data to be written to file
+ let mut file_list = Vec::new(); // file list used for making manifest later on
+ let mut bytes_written = 16; // where we should start putting files
+ for i in 0..self.file_data.len() {
+ let mut file_data_bytes = Vec::new();
+ file_data_bytes.extend_from_slice(&self.file_data[i].data);
+ file_data.extend_from_slice(&file_data_bytes);
+ file_list.push(FarFileInfo {
+ name: self.file_data[i].name.clone(),
+ size: self.file_data[i].size,
+ offset: bytes_written,
+ });
+ bytes_written += self.file_data[i].size;
+ }
+ // write manifest
+ let mut manifest = Vec::new();
+ // write file count
+ manifest.extend_from_slice(&self.file_count.to_le_bytes());
+ // for each file, write (size, size, offset, name length, name)
+ for i in 0..self.file_list.len() {
+ manifest.extend_from_slice(&file_list[i].size.to_le_bytes());
+ manifest.extend_from_slice(&file_list[i].size.to_le_bytes());
+ manifest.extend_from_slice(&file_list[i].offset.to_le_bytes());
+ manifest.extend_from_slice(&(file_list[i].name.len() as u32).to_le_bytes());
+ manifest.extend_from_slice(&file_list[i].name.as_bytes());
+ }
+ // write manifest offset
+ let manifest_offset = bytes_written;
+ header.extend_from_slice(&manifest_offset.to_le_bytes());
+
+ // join vecs together
+ let mut output = Vec::new();
+ output.extend_from_slice(&header);
+ output.extend_from_slice(&file_data);
+ output.extend_from_slice(&manifest);
+ output
+ }
+}
+
+/// Tests if a buffer is a valid FarArchive.
+/// Returns a FarArchive struct if it is, or an error if it is not.
+///
+/// # Examples
+/// ```
+/// use std::fs;
+/// use libfar::farlib;
+/// let buffer = fs::read("test.far").expect("Failed to read file");
+/// let test = farlib::test(&buffer);
+/// match test {
+/// Ok(archive) => {
+/// println!("test.far is a valid archive");
+/// },
+/// Err(e) => {
+/// println!("test.far is not a valid archive: {}", e);
+/// }
+/// }
+/// ```
+pub fn test(file : &Vec<u8>) -> Result<FarArchive, String> {
+ let mut reader = BufReader::new(&file[..]);
+ let mut magic = [0u8; 8];
+ reader.read_exact(&mut magic).unwrap();
+ if magic != *b"FAR!byAZ" {
+ return Err("Not a Far archive".to_string());
+ }
+ let mut version = [0; 4];
+ reader.read_exact(&mut version).unwrap();
+ let version = u32::from_le_bytes(version);
+ // get list of files
+ let files = list_files(file).expect("Failed to list files");
+ Ok(FarArchive {
+ version,
+ file_count: files.len() as u32,
+ file_list: files,
+ file_data: vec![],
+ })
+}
+
+fn list_files(file : &Vec<u8>) -> Result<Vec<FarFileInfo>, String> {
+ // manifest offset is at 12 bytes (u32)
+ let mut reader = BufReader::new(&file[12..]);
+ let mut offset = [0u8; 4];
+ reader.read_exact(&mut offset).unwrap();
+ let offset = u32::from_le_bytes(offset);
+ // move to manifest
+ reader = BufReader::new(&file[offset as usize..]);
+ // read u32 for number of files
+ let mut num_files = [0u8; 4];
+ reader.read_exact(&mut num_files).unwrap();
+ let num_files = u32::from_le_bytes(num_files);
+ // for each file, read u32 for size, u32 for size again (stored twice for some reason), u32 for offset, u32 for name length, name
+ let mut files = Vec::new();
+ for i in 0..num_files {
+ let mut size = [0u8; 4];
+ reader.read_exact(&mut size).expect(format!("Failed to read size for file {}", i).as_str());
+ let size = u32::from_le_bytes(size);
+ let mut size2 = [0u8; 4];
+ reader.read_exact(&mut size2).expect(format!("Failed to read size for file {}", i).as_str());
+ let _size2 = u32::from_le_bytes(size2); // why is this stored twice? f*** you EA
+ let mut offset = [0u8; 4];
+ reader.read_exact(&mut offset).expect(format!("Failed to read offset for file {}", i).as_str());
+ let offset = u32::from_le_bytes(offset);
+ let mut name_len = [0u8; 4];
+ reader.read_exact(&mut name_len).expect(format!("Failed to read name length for file {}", i).as_str());
+ let name_len = u32::from_le_bytes(name_len);
+ let mut name = vec![0u8; name_len as usize];
+ reader.read_exact(&mut name).expect(format!("Failed to read name for file {}", i).as_str());
+ files.push(FarFileInfo {
+ name: String::from_utf8(name).unwrap(),
+ size,
+ offset,
+ });
+ }
+ Ok(files)
+}