mirror of
https://github.com/sagiegurari/duckscript
synced 2024-09-29 20:54:34 +00:00
parent
a1e22da5fa
commit
6249efda49
13
.editorconfig
Normal file
13
.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_size = 2
|
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
* text eol=lf
|
||||||
|
*.ico binary
|
||||||
|
*.woff binary
|
18
.gitignore
vendored
18
.gitignore
vendored
|
@ -1,10 +1,10 @@
|
||||||
# Generated by Cargo
|
.idea
|
||||||
# will have compiled files and executables
|
.c9
|
||||||
/target/
|
target/
|
||||||
|
temp/
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
Cargo.lock
|
||||||
|
**/*.log
|
||||||
|
dump.rdb
|
||||||
|
/rs*.sh
|
||||||
|
/docs/_site
|
||||||
|
|
64
.travis.yml
Normal file
64
.travis.yml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
language: rust
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- rust: nightly
|
||||||
|
include:
|
||||||
|
# Stable
|
||||||
|
- rust: stable
|
||||||
|
os: linux
|
||||||
|
- rust: stable
|
||||||
|
os: osx
|
||||||
|
- rust: stable
|
||||||
|
os: windows
|
||||||
|
# Beta
|
||||||
|
- rust: beta
|
||||||
|
os: linux
|
||||||
|
- rust: beta
|
||||||
|
os: osx
|
||||||
|
- rust: beta
|
||||||
|
os: windows
|
||||||
|
# Nightly
|
||||||
|
- rust: nightly
|
||||||
|
os: linux
|
||||||
|
- rust: nightly
|
||||||
|
os: osx
|
||||||
|
- rust: nightly
|
||||||
|
os: windows
|
||||||
|
# Deploy jobs
|
||||||
|
- env: DEPLOY=1
|
||||||
|
rust: stable
|
||||||
|
os: osx
|
||||||
|
script:
|
||||||
|
- cargo make zip-release-ci-flow --env TARGET=x86_64-apple-darwin
|
||||||
|
- env: DEPLOY=1
|
||||||
|
rust: stable
|
||||||
|
os: windows
|
||||||
|
before_script:
|
||||||
|
- rustup target add x86_64-pc-windows-msvc
|
||||||
|
- cargo install --debug cargo-make
|
||||||
|
script:
|
||||||
|
- cargo make zip-release-ci-flow --env TARGET=x86_64-pc-windows-msvc
|
||||||
|
- env: DEPLOY=1
|
||||||
|
rust: stable
|
||||||
|
os: linux
|
||||||
|
script:
|
||||||
|
- cargo make zip-release-ci-flow --env TARGET=x86_64-unknown-linux-musl
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- musl-tools
|
||||||
|
before_script:
|
||||||
|
- cargo install --debug cargo-make
|
||||||
|
script:
|
||||||
|
- cargo make --no-workspace workspace-ci-flow
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: U5ziHSOtcXHe7XX1KdEIIVVbOd/AKMvXquYoS2GJnnil3gxGRarOGkZ/F3iFGEzccXwNPuvhnBwSciVMx/Rsx4gl6ET8bila8T4/AppRhORBM4RBfAweJVZUibDoGzQVjc9Y4Aeo2E2oy8yMNFAh8WLu9tY4v5x/hlgUmffW88j3Mg6EdJb5rMQZ0aqyuTzJm6XvDixQQLaJ1bjONFAG7eRQzfs+TC/wiDXipm2bs/wcLcCl/GeB3KDyT7GH1dkeyChwdVt2rqiQM2N7gwSVKZsiV9ZFcv4SFRdwl/W2FKSAlNeIF68qXA4OAaWQxWIlfHqUk6iYgzCA8XbFIFDgRFjFvLEP5fK8Ul5gsOCZF6D9hSDYXvFvbPEqqaOKJUlxZrOaID8+j64E5gI5cPMGlYG4OPkqRYvx/NsES4OUhkrfr8j2wFAUqBPrBqCOnbp1PUkLFoQGRxy28gudhoHPjfPYcFokNErriwz4HG05UBIeGQzUKLNynxVFrwMN8u8UxOh6TDMmOa+okWLcn0jnZPTTi7zCtz34G4ltE/ikL5ERK0tV/lyvqbI6PXQfpW1mXVWf00pfkW88vXaE/uYlOdHU3FnpcGV4nynpniIvk0VJ78Fp/g2cwxw4QTMb6rIjwxmH0Dl9s1aiU/fNHnm/6vE46dwdOdykj1Uim0XgVmw=
|
||||||
|
file_glob: true
|
||||||
|
file: "*.zip"
|
||||||
|
on:
|
||||||
|
condition: $DEPLOY = 1
|
||||||
|
tags: true
|
||||||
|
skip_cleanup: true
|
||||||
|
overwrite: true
|
5
CHANGELOG.md
Executable file
5
CHANGELOG.md
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
## CHANGELOG
|
||||||
|
|
||||||
|
### v0.1.0
|
||||||
|
|
||||||
|
* Initial release
|
6
Cargo.toml
Executable file
6
Cargo.toml
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
[workspace]
|
||||||
|
members = [
|
||||||
|
"duckscript",
|
||||||
|
"duckscript_sdk",
|
||||||
|
"duckscript_cli",
|
||||||
|
]
|
202
LICENSE
Normal file
202
LICENSE
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
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.
|
||||||
|
|
112
Makefile.toml
Normal file
112
Makefile.toml
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
|
||||||
|
[env]
|
||||||
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
|
||||||
|
CARGO_MAKE_DUCKSCRIPT_PROJECT_NAME = "duckscript"
|
||||||
|
|
||||||
|
[env.sdk]
|
||||||
|
CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = "duckscript_sdk;duckscript_cli"
|
||||||
|
|
||||||
|
[config]
|
||||||
|
additional_profiles = [
|
||||||
|
"ci-coverage-tasks",
|
||||||
|
"ci-all-build-tasks",
|
||||||
|
"publish-pre-cleanup"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.generate-sdk-docs]
|
||||||
|
workspace = false
|
||||||
|
command = "cargo"
|
||||||
|
args = [ "run", "--", "./sdkdocs.ds", ]
|
||||||
|
|
||||||
|
[tasks.generate-readme]
|
||||||
|
script = [
|
||||||
|
'''
|
||||||
|
echo "generating readme file"
|
||||||
|
rm -f ./README.md
|
||||||
|
cat ./docs/_includes/README.md ./docs/_includes/nav.md ./docs/_includes/content.md >> README.md
|
||||||
|
sed -i 's,https://github.com/sagiegurari/duckscript/blob/master/.github,.github,g' ./README.md
|
||||||
|
'''
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.workspace-docs]
|
||||||
|
dependencies = [
|
||||||
|
"generate-sdk-docs",
|
||||||
|
"generate-readme"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.install_local]
|
||||||
|
workspace = false
|
||||||
|
cwd = "./duckscript_cli"
|
||||||
|
command = "cargo"
|
||||||
|
args = [ "install", "--force", "--path", "." ]
|
||||||
|
|
||||||
|
[tasks.zip-release-ci-flow]
|
||||||
|
description = "Compiles the binary in release mode and zips it up"
|
||||||
|
category = "CI"
|
||||||
|
workspace = false
|
||||||
|
condition = { env_set = ["TARGET"] }
|
||||||
|
dependencies = [
|
||||||
|
"clean",
|
||||||
|
"setup-build-env",
|
||||||
|
"build-release-for-target",
|
||||||
|
"zip-release-binary-for-target"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.build-release-for-target]
|
||||||
|
description = "Makes a release build for a given target"
|
||||||
|
condition = { env_set = [ "TARGET" ] }
|
||||||
|
command = "cargo"
|
||||||
|
args = [
|
||||||
|
"build",
|
||||||
|
"--release",
|
||||||
|
"--all-features",
|
||||||
|
"--target",
|
||||||
|
"${TARGET}"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.zip-release-binary-for-target]
|
||||||
|
description = "Zips up the release binary, README, and license(s)"
|
||||||
|
category = "Publish"
|
||||||
|
condition = { env_set = [ "TARGET" ] }
|
||||||
|
env = { "OUTPUT_NAME" = "${CARGO_MAKE_DUCKSCRIPT_PROJECT_NAME}-${TARGET}"}
|
||||||
|
script_runner = "@shell"
|
||||||
|
script = [
|
||||||
|
"mkdir ${OUTPUT_NAME}",
|
||||||
|
"cp target/$TARGET/release/${CARGO_MAKE_DUCKSCRIPT_PROJECT_NAME} ${OUTPUT_NAME}/",
|
||||||
|
"cp README.md LICENSE* ${OUTPUT_NAME}/",
|
||||||
|
"zip -r ${OUTPUT_NAME}.zip ${OUTPUT_NAME}",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.zip-release-binary-for-target.windows]
|
||||||
|
script = [
|
||||||
|
"mkdir ${OUTPUT_NAME}",
|
||||||
|
"dir target",
|
||||||
|
"powershell copy-item -path target/${TARGET}/release/${CARGO_MAKE_DUCKSCRIPT_PROJECT_NAME}.exe -destination ${OUTPUT_NAME}",
|
||||||
|
"powershell copy-item -path README.md -destination ${OUTPUT_NAME}",
|
||||||
|
"powershell copy-item -path LICENSE -destination ${OUTPUT_NAME}",
|
||||||
|
"dir ${OUTPUT_NAME}",
|
||||||
|
"powershell Compress-Archive -Path ${OUTPUT_NAME}/* -DestinationPath ${OUTPUT_NAME}.zip",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.setup-build-env]
|
||||||
|
description = "Sets up any non-rust dependencies in the build environment"
|
||||||
|
linux_alias = "setup-musl"
|
||||||
|
mac_alias = "empty"
|
||||||
|
windows_alias = "empty"
|
||||||
|
|
||||||
|
[tasks.setup-musl]
|
||||||
|
description = "Sets up a musl build environment"
|
||||||
|
windows_alias = "empty"
|
||||||
|
mac_alias = "empty"
|
||||||
|
condition = { env_set = [ "TARGET" ], env_true = [ "CARGO_MAKE_CI" ] }
|
||||||
|
env = { "OPENSSL_DIR" = "${HOME}/openssl-musl", "OPENSSL_VERSION" = "1.0.2l" }
|
||||||
|
script = [
|
||||||
|
'''
|
||||||
|
rustup target add "$TARGET"
|
||||||
|
curl https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | tar xzf -
|
||||||
|
cd openssl-$OPENSSL_VERSION
|
||||||
|
CC=musl-gcc ./Configure --prefix="$OPENSSL_DIR" no-dso no-ssl2 no-ssl3 linux-x86_64 -fPIC
|
||||||
|
make -j"$(nproc)"
|
||||||
|
make install
|
||||||
|
'''
|
||||||
|
]
|
503
README.md
503
README.md
|
@ -1,2 +1,503 @@
|
||||||
# duckscript
|
# duckscript
|
||||||
Simple, extendable and embeddable scripting language.
|
|
||||||
|
| duckscript | SDK | CLI |
|
||||||
|
| ----------- | ------- | ----------- |
|
||||||
|
| [![crates.io](https://img.shields.io/crates/v/duckscript.svg)](https://crates.io/crates/duckscript) | [![crates.io](https://img.shields.io/crates/v/duckscriptsdk.svg)](https://crates.io/crates/duckscriptsdk) | [![crates.io](https://img.shields.io/crates/v/duckscript_cli.svg)](https://crates.io/crates/duckscript_cli) |
|
||||||
|
| [![downloads](https://img.shields.io/crates/d/duckscript.svg)](https://crates.io/crates/duckscript) | [![downloads](https://img.shields.io/crates/d/duckscriptsdk.svg)](https://crates.io/crates/duckscriptsdk) | [![downloads](https://img.shields.io/crates/d/duckscript_cli.svg)](https://crates.io/crates/duckscript_cli) |
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/sagiegurari/duckscript.svg?branch=master)](http://travis-ci.org/sagiegurari/duckscript)
|
||||||
|
[![Build status](https://ci.appveyor.com/api/projects/status/github/sagiegurari/duckscript?branch=master&svg=true)](https://ci.appveyor.com/project/sagiegurari/duckscript)
|
||||||
|
[![codecov](https://codecov.io/gh/sagiegurari/duckscript/branch/master/graph/badge.svg)](https://codecov.io/gh/sagiegurari/duckscript)
|
||||||
|
[![license](https://img.shields.io/crates/l/duckscript.svg)](https://github.com/sagiegurari/duckscript/blob/master/LICENSE)
|
||||||
|
[![Built with cargo-make](https://sagiegurari.github.io/cargo-make/assets/badges/cargo-make.svg)](https://sagiegurari.github.io/cargo-make)
|
||||||
|
|
||||||
|
> Simple, extendable and embeddable scripting language.
|
||||||
|
|
||||||
|
* [Overview](#overview)
|
||||||
|
* [Language Goals](#lang-goals)
|
||||||
|
* [Installation](#installation)
|
||||||
|
* [Binary Release](#installation-binary-release)
|
||||||
|
* [Duckscript Tutorial](#tutorial)
|
||||||
|
* [Hello World Example](#tutorial-hello-world)
|
||||||
|
* [Commands](#tutorial-commands)
|
||||||
|
* [Passing Arguments](#tutorial-commands-passing-arguments)
|
||||||
|
* [Storing Output](#tutorial-commands-storing-output)
|
||||||
|
* [Using Variables](#tutorial-commands-using-variables)
|
||||||
|
* [Labels](#tutorial-labels)
|
||||||
|
* [Comments](#tutorial-comments)
|
||||||
|
* [Pre Processing](#tutorial-pre-processing)
|
||||||
|
* [!include_files](#tutorial-pre-processing-including-files)
|
||||||
|
* [!print](#tutorial-pre-processing-printout)
|
||||||
|
* [Standard API](#tutorial-standard-api)
|
||||||
|
* [Commands Instead Of Language Features](#tutorial-standard-api-commands-lang-features)
|
||||||
|
* [Full SDK Docs](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md)
|
||||||
|
* [Final Notes](#tutorial-final-notes)
|
||||||
|
* [Duckscript Command Implementation Tutorial](#sdk-tutorial)
|
||||||
|
* [Standard Commands](#sdk-tutorial-standard-commands)
|
||||||
|
* [Context Commands](#sdk-tutorial-context-commands)
|
||||||
|
* [Duckscript Embedding Tutorial](#embed-tutorial)
|
||||||
|
* [Setting Up The Context](#embed-tutorial-setup-context)
|
||||||
|
* [Running The Script](#embed-tutorial-running)
|
||||||
|
* [Contributing](#contributing)
|
||||||
|
* [Release History](https://github.com/sagiegurari/duckscript/blob/master/CHANGELOG.md)
|
||||||
|
* [License](#license)
|
||||||
|
|
||||||
|
<a name="overview"></a>
|
||||||
|
## Overview
|
||||||
|
Duckscript is a simple, extendable and embeddable scripting language.<br>
|
||||||
|
The language itself has only few rules and most common language features are implemented as commands rather than part of the language itself.
|
||||||
|
|
||||||
|
<a name="lang-goals"></a>
|
||||||
|
### Language Goals
|
||||||
|
Duckscript scripting language goals are:
|
||||||
|
|
||||||
|
* Simple - This is probably the simplest language you will ever see.
|
||||||
|
* Extendable - Instead of having common features such as functions and conditional blocks be a part of the language, they are actually part of the API. So they can easily be replaced/modified or you can add more 'feature' like commands on your own.
|
||||||
|
* Embeddable - One of the main purposes of this language is to allow other libraries/executables/apps have scripting capability by embedding duckscript. Embedding is easy (for [rust](https://www.rust-lang.org/)) and requires only few lines of code.
|
||||||
|
|
||||||
|
<a name="installation"></a>
|
||||||
|
## Installation
|
||||||
|
If you have [rust](https://www.rust-lang.org/), just run the following command
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install --force duckscript_cli
|
||||||
|
```
|
||||||
|
|
||||||
|
This will install duckscript script runner, the standard duckscript SDK and the duckscript CLI.<br>
|
||||||
|
You should then have a **duckscript** executable in your ~/.cargo/bin directory.<br>
|
||||||
|
Make sure to add ~/.cargo/bin directory to your PATH variable.
|
||||||
|
|
||||||
|
<a name="installation-binary-release"></a>
|
||||||
|
### Binary Release
|
||||||
|
Binary releases are available in the [github releases page](https://github.com/sagiegurari/duckscript/releases).<br>
|
||||||
|
The following binaries are available for each release:
|
||||||
|
|
||||||
|
* x86_64-unknown-linux-musl
|
||||||
|
* x86_64-apple-darwin
|
||||||
|
* x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
<a name="tutorial"></a>
|
||||||
|
## Duckscript Tutorial
|
||||||
|
The following sections will teach you how to write and run duck scripts.
|
||||||
|
|
||||||
|
<a name="tutorial-hello-world"></a>
|
||||||
|
### Hello World Example
|
||||||
|
Let's take a really simple example (all examples are located in the [examples](https://github.com/sagiegurari/duckscript/tree/master/examples) directory:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo hello world
|
||||||
|
```
|
||||||
|
|
||||||
|
Running this script is done using the **duckscript** executable as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
duckscript ./examples/hello_world.ds
|
||||||
|
```
|
||||||
|
|
||||||
|
We will understand more and breakdown this down in the following sections.
|
||||||
|
|
||||||
|
<a name="tutorial-commands"></a>
|
||||||
|
### Commands
|
||||||
|
Commands are the basis of everything in duckscript.<br>
|
||||||
|
Commands may execute some action (like printing "hello world" to the console) or serve as flow control (such as functions or if/else conditions).<br>
|
||||||
|
In order to invoke an action, simply write the action name:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo
|
||||||
|
```
|
||||||
|
|
||||||
|
The basic syntax of a command line is:
|
||||||
|
|
||||||
|
```
|
||||||
|
[:label] [output variable =] [command [arguments]]
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-commands-passing-arguments"></a>
|
||||||
|
#### Passing Arguments
|
||||||
|
Commands may accept arguments, for example the command **echo** may accept any number of arguments and it will print all of them.<br>
|
||||||
|
Arguments are separated with the space character.<br>
|
||||||
|
So in the example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo hello world
|
||||||
|
```
|
||||||
|
|
||||||
|
The **echo** command got 2 arguments: "hello" and "world".<br>
|
||||||
|
If your argument contains a space, you can wrap the entire argument with the ```"``` character as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
In which case the **echo** command got only one argument: "hello world" and prints it.<br>
|
||||||
|
You can escape the ```"``` character using the ```"\"``` character, for example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text 'hello "world"'
|
||||||
|
echo "hello \"world\""
|
||||||
|
```
|
||||||
|
|
||||||
|
In the above example, the **echo** command got one argument: 'hello "world"' and prints it.<br>
|
||||||
|
The ```"\"``` is also used to escape the following:
|
||||||
|
|
||||||
|
* \n - End of line
|
||||||
|
* \r - Carriage return
|
||||||
|
* \t - Tab character
|
||||||
|
|
||||||
|
<a name="tutorial-commands-storing-output"></a>
|
||||||
|
#### Storing Output
|
||||||
|
Commands may return an output which can be stored in a variable.<br>
|
||||||
|
Variables in duckscript have no strict type.<br>
|
||||||
|
In the following example, the **set** command takes one argument and stores it in the **out** variable.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
out = set "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
Duckscript has only global scope, so once you have stored a value in a variable, you may use it anywhere in your script.
|
||||||
|
|
||||||
|
<a name="tutorial-commands-using-variables"></a>
|
||||||
|
#### Using Variables
|
||||||
|
Stored variables can be later on used as arguments for other commands.<br>
|
||||||
|
In order to use a variable, we need to wrap it as follows: ```${variable}```.<br>
|
||||||
|
<br>
|
||||||
|
The following example uses the **set** command to store a value in the **out** variable and then prints it:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
out = set "hello world"
|
||||||
|
|
||||||
|
# This will print: "The out variable holds the value: hello world"
|
||||||
|
echo The out variable holds the value: ${out}
|
||||||
|
|
||||||
|
# This will print: "To use the out variable just write: ${out}"
|
||||||
|
echo To use the out variable just write: \${out}
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, although **out** holds the value **hello world** which contains a space, it is still considered as a single input argument to the **echo** command.<br>
|
||||||
|
In the second echo command we prevented the variable name from being replaced by escaping it using the ```\``` character.
|
||||||
|
|
||||||
|
<a name="tutorial-labels"></a>
|
||||||
|
### Labels
|
||||||
|
Labels are simple textual names you can give to a specific line.<br>
|
||||||
|
Commands like **goto** can then be used to make the script execution jump from its current position to the label position.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
goto :good
|
||||||
|
|
||||||
|
echo error!!!!
|
||||||
|
|
||||||
|
:good echo yay!!!!
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-comments"></a>
|
||||||
|
### Comments
|
||||||
|
Comments are not executed and are simply in the code for documentation purposes.<br>
|
||||||
|
A document line must start with the ```#``` character.<br>
|
||||||
|
You can also have a comment after the command and the command will ignore it.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# This is just a comment
|
||||||
|
|
||||||
|
echo This will print # But this will not
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing"></a>
|
||||||
|
### Pre Processing
|
||||||
|
Pre processing is the phase that duckscript is parsing the script content.<br>
|
||||||
|
It is possible to run specific commands at that phase to modify the script during the parsing phase.<br>
|
||||||
|
|
||||||
|
The basic syntax of a pre processing command line is:
|
||||||
|
|
||||||
|
```
|
||||||
|
!command [arguments]
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing-including-files"></a>
|
||||||
|
#### !include_files
|
||||||
|
The include_files command enables you to load script files into the position of the pre processor command.<br>
|
||||||
|
Basically it enables you to include many scripts and generate one bigger script for runtime.<br>
|
||||||
|
The include files command accepts any number of files and all will be loaded by the order they are defined.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# load the hello_world.ds script here
|
||||||
|
!include_files ./hello_world.ds
|
||||||
|
|
||||||
|
# load 2 scripts here. The hello_world.ds is loaded again.
|
||||||
|
!include_files ./hello_world.ds ./use_variable.ds
|
||||||
|
```
|
||||||
|
|
||||||
|
Important to note that the script paths included are relative to the script file including them and not to the current working directory.
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing-including-files"></a>
|
||||||
|
#### !print
|
||||||
|
The print pre processing command allows to print any number of arguments, which could be useful for debugging.<br>
|
||||||
|
In the following example, although the print command comes after the echo command, it will execute first as it is invoked in the parsing phase and not in the script execution phase which comes later:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# this will print "hello world during script execution"
|
||||||
|
echo hello world during script execution
|
||||||
|
|
||||||
|
# this will print "hello world during parsing"
|
||||||
|
!print hello world during parsing
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api"></a>
|
||||||
|
### Standard API
|
||||||
|
Duckscript is split to several modules and while the script runner does not require it, by default it will come with the standard duckscript API called the duckscript SDK.<br>
|
||||||
|
This SDK holds the most common commands, some which execute actions (such as echo) and some which serve as flow control (such as function).<br>
|
||||||
|
The SDK enables users to develop their scripts and have a good starting point without the need to develop the commands on their own (as that is a bit more complex).
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api-commands-lang-features"></a>
|
||||||
|
#### Commands Instead Of Language Features
|
||||||
|
As mentioned before, duckscript is really simple and only has few basic rules.<br>
|
||||||
|
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.<br>
|
||||||
|
This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__Function):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
function print_first_and_second_argument
|
||||||
|
echo ${1} ${2}
|
||||||
|
return printed
|
||||||
|
end_function
|
||||||
|
|
||||||
|
function run_flow
|
||||||
|
status = print_first_and_second_argument hello world
|
||||||
|
echo The printout status is: ${status}
|
||||||
|
end_function
|
||||||
|
|
||||||
|
run_flow
|
||||||
|
```
|
||||||
|
|
||||||
|
This example demonstrates how functions as a concept do not need to be part of the language and can be implemented by anyone as a command.<br>
|
||||||
|
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.
|
||||||
|
|
||||||
|
Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__If):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
if set false
|
||||||
|
echo should not be here
|
||||||
|
elseif set true
|
||||||
|
echo in else if but not done yet
|
||||||
|
|
||||||
|
if set true
|
||||||
|
echo nested if
|
||||||
|
end_if
|
||||||
|
else
|
||||||
|
echo should not be here
|
||||||
|
end_if
|
||||||
|
```
|
||||||
|
|
||||||
|
Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__ForIn):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
range = array 1 2 3
|
||||||
|
|
||||||
|
for i in range
|
||||||
|
for j in range
|
||||||
|
echo i: ${i} j: ${j}
|
||||||
|
end_for
|
||||||
|
end_for
|
||||||
|
|
||||||
|
release range
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api-full-sdk-docs"></a>
|
||||||
|
#### Full SDK Docs
|
||||||
|
The full SDK docs can be found [here](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md)
|
||||||
|
|
||||||
|
Keep in mind that the command names (such as **sdk::Echo**) can be used to invoke the commands, however for simplicity, the documentation
|
||||||
|
examples uses the alias form of the commands (for example: **echo**).<br>
|
||||||
|
Each command may have multiple aliases which can be used to invoke it.
|
||||||
|
|
||||||
|
<a name="tutorial-final-notes"></a>
|
||||||
|
### Final Notes
|
||||||
|
That's It!!!!<br>
|
||||||
|
That is all the language.<br>
|
||||||
|
Short, simple, only few rules to follow and you mastered duckscript.<br>
|
||||||
|
|
||||||
|
If you want to know what more you can do with it, look at the [SDK docs](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md).<br>
|
||||||
|
If you want to know how to write your own commands or embed the duckscript runtime in your application, continue reading.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial"></a>
|
||||||
|
## Duckscript Command Implementation Tutorial
|
||||||
|
Want to write new custom commands so you can use them in your duckscripts? great!<br>
|
||||||
|
Hopefully the following sections will help you gain the basic knowledge on how to write them.<br>
|
||||||
|
|
||||||
|
First of all it is important to understand that there are two types of commands:
|
||||||
|
|
||||||
|
* Commands which execute some action like copying files, printing some text to the console or returning an environment variable.
|
||||||
|
* Commands which provide flow control or some more complex action and require modifying the internal context in runtime.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial-standard-commands"></a>
|
||||||
|
## Standard Commands
|
||||||
|
Commands are structs that must implement the Command trait.<br>
|
||||||
|
They must have a name, which is used to invoke the command.<br>
|
||||||
|
They optionally may have aliases which can also be used too invoke the command.<br>
|
||||||
|
They should return help documentation in markdown in order to generate SDK documentation (must for PRs to duckscript SDK).<br>
|
||||||
|
And they must implement the **run** function which holds the command logic.<br>
|
||||||
|
|
||||||
|
The run function accepts the command arguments (variables already replaced to actual values) and returns the command result.<br>
|
||||||
|
The command result can be one of the following:
|
||||||
|
|
||||||
|
* Continue(Option<String>) - Tells the runner to continue to the next command and optionally set the output variable the given value.
|
||||||
|
* GoTo(Option<String>, GoToValue) - Tells the runner to jump to the requested line or label and optionally set the output variable the given value.
|
||||||
|
* Error(String) - Tells the runner to stop the exection and return the error message.
|
||||||
|
* Exit(Option<String>) - Tells the runner to stop the execution and optionally set the output variable the given value.
|
||||||
|
|
||||||
|
Let's implement a simple **set** command which accepts a single argument and sets the output variable to that value.<br>
|
||||||
|
And if no argument was provided, return a None which will tell the runner to delete the output variable.<br>
|
||||||
|
Afterwards the runner should continue to the next line.<br>
|
||||||
|
So we need to use a Continue(Option<String>) result.<br>
|
||||||
|
Full example:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
struct SetCommand {}
|
||||||
|
|
||||||
|
impl Command for SetCommand {
|
||||||
|
fn name(&self) -> String {
|
||||||
|
"set".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run(&self, arguments: Vec<String>) -> CommandResult {
|
||||||
|
let output = if arguments.is_empty() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(arguments[0].clone())
|
||||||
|
};
|
||||||
|
|
||||||
|
CommandResult::Continue(output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's implement a **get_env** command which pulls an environment variable value and sets the output variable with that value.<br>
|
||||||
|
In case no input was provided we will throw an error, otherwise we will use the first input as the environment variable key.<br>
|
||||||
|
We will return the value if exists or nothing if it does not.<br>
|
||||||
|
Full example:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
struct GetEnvCommand {
|
||||||
|
package: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Command for GetEnvCommand {
|
||||||
|
fn name(&self) -> String {
|
||||||
|
"get_env".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run(&self, arguments: Vec<String>) -> CommandResult {
|
||||||
|
if arguments.is_empty() {
|
||||||
|
CommandResult::Error("Missing environment variable name.".to_string())
|
||||||
|
} else {
|
||||||
|
match env::var(&arguments[0]) {
|
||||||
|
Ok(value) => CommandResult::Continue(Some(value)),
|
||||||
|
Err(_) => CommandResult::Continue(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can look at more examples in the duckscript_sdk folder.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial-context-commands"></a>
|
||||||
|
## Context Commands
|
||||||
|
Context commands are exactly the same as standard commands except that they have access to the runtime context.<br>
|
||||||
|
Therefore they implement the same Command trait but this time instead of implementing the run function, they need to implement the following:
|
||||||
|
|
||||||
|
* requires_context - Must return true
|
||||||
|
* run_with_context - The same logic you would put in the run function but now you have access to a lot more of the runtime context.
|
||||||
|
|
||||||
|
The run_with_context signature is as follows:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
/// Run the instruction with access to the runtime context.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `arguments` - The command arguments array
|
||||||
|
/// * `state` - Internal state which is only used by commands to store/pull data
|
||||||
|
/// * `variables` - All script variables
|
||||||
|
/// * `output_variable` - The output variable name (if defined)
|
||||||
|
/// * `instructions` - The entire list of instructions which make up the currently running script
|
||||||
|
/// * `commands` - The currently known commands
|
||||||
|
/// * `line` - The current instruction line number (global line number after including all scripts into one global script)
|
||||||
|
fn run_with_context(
|
||||||
|
&self,
|
||||||
|
arguments: Vec<String>,
|
||||||
|
state: &mut HashMap<String, StateValue>,
|
||||||
|
variables: &mut HashMap<String, String>,
|
||||||
|
output_variable: Option<String>,
|
||||||
|
instructions: &Vec<Instruction>,
|
||||||
|
commands: &mut Commands,
|
||||||
|
line: usize,
|
||||||
|
) -> CommandResult;
|
||||||
|
```
|
||||||
|
|
||||||
|
With access to this context you can add/remove/switch commands in runtime, store/pull internal state, add/remove/change variables and so on...
|
||||||
|
|
||||||
|
<a name="embed-tutorial"></a>
|
||||||
|
## Duckscript Embedding Tutorial
|
||||||
|
Embedding duckscript is really simple and this is one of the language main goals.<br>
|
||||||
|
The duckscript cli basically embeds duckscript so you can look at it as a reference, but basically it boils down to really few lines of code:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
let mut context = Context::new();
|
||||||
|
duckscriptsdk::load(&mut context.commands)?;
|
||||||
|
runner::run_script_file(file, context)?;
|
||||||
|
```
|
||||||
|
|
||||||
|
That's it!<br>
|
||||||
|
Unless you want to provide your own custom SDK, prepopulate the runtime context with custom variables/state or
|
||||||
|
pull information out of the context after invocation than those 3 lines of code is all you need to do.<br>
|
||||||
|
Let's go over it line by line.<br>
|
||||||
|
|
||||||
|
<a name="embed-tutorial-setup-context"></a>
|
||||||
|
## Setting Up The Context
|
||||||
|
The context holds the initial known commands, variables and state (internal objects used by commands).<br>
|
||||||
|
Running the ```Context::new()``` simply creates a new empty context.<br>
|
||||||
|
You can add to it any command, variable or state object you want before running the scripts.<br>
|
||||||
|
In our example we load all default standard API commands into the new context via: ```duckscriptsdk::load(&mut context.commands)?;```
|
||||||
|
|
||||||
|
<a name="embed-tutorial-running"></a>
|
||||||
|
## Running The Script
|
||||||
|
After we have a context setup, we will run the script.<br>
|
||||||
|
The **runner** enables to run a script text or a script file.<br>
|
||||||
|
The following public functions are available:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
/// Executes the provided script with the given context
|
||||||
|
pub fn run_script(text: &str, context: Context) -> Result<Context, ScriptError>;
|
||||||
|
|
||||||
|
/// Executes the provided script file with the given context
|
||||||
|
pub fn run_script_file(file: &str, context: Context) -> Result<Context, ScriptError>;
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="contributing"></a>
|
||||||
|
## Contributing
|
||||||
|
There are many ways to contribute to duckscript, including:
|
||||||
|
|
||||||
|
* Writing more commands and adding them to the standard SDK
|
||||||
|
* Improving existing commands by adding more features
|
||||||
|
* Improving the documentation
|
||||||
|
* Opening issues with new feature requests or bugs found
|
||||||
|
* Spreading the word :)
|
||||||
|
|
||||||
|
As for expanding the language, I personally prefer not to make it complex.<br>
|
||||||
|
Let's try to add more language feature using commands and not changing the language itself.<br>
|
||||||
|
|
||||||
|
See [contributing guide](https://github.com/sagiegurari/duckscript/blob/master/.github/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
<a name="history"></a>
|
||||||
|
## Release History
|
||||||
|
|
||||||
|
See [Changelog](https://github.com/sagiegurari/duckscript/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
<a name="license"></a>
|
||||||
|
## License
|
||||||
|
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.
|
||||||
|
|
50
appveyor.yml
Normal file
50
appveyor.yml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
os: Visual Studio 2015
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
# Stable channel
|
||||||
|
- TARGET: i686-pc-windows-gnu
|
||||||
|
CHANNEL: stable
|
||||||
|
- TARGET: i686-pc-windows-msvc
|
||||||
|
CHANNEL: stable
|
||||||
|
- TARGET: x86_64-pc-windows-gnu
|
||||||
|
CHANNEL: stable
|
||||||
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
|
CHANNEL: stable
|
||||||
|
# Beta channel
|
||||||
|
- TARGET: i686-pc-windows-gnu
|
||||||
|
CHANNEL: beta
|
||||||
|
- TARGET: i686-pc-windows-msvc
|
||||||
|
CHANNEL: beta
|
||||||
|
- TARGET: x86_64-pc-windows-gnu
|
||||||
|
CHANNEL: beta
|
||||||
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
|
CHANNEL: beta
|
||||||
|
# Nightly channel
|
||||||
|
- TARGET: i686-pc-windows-gnu
|
||||||
|
CHANNEL: nightly
|
||||||
|
- TARGET: i686-pc-windows-msvc
|
||||||
|
CHANNEL: nightly
|
||||||
|
- TARGET: x86_64-pc-windows-gnu
|
||||||
|
CHANNEL: nightly
|
||||||
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
|
CHANNEL: nightly
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- CHANNEL: nightly
|
||||||
|
- TARGET: i686-pc-windows-gnu
|
||||||
|
- TARGET: x86_64-pc-windows-gnu
|
||||||
|
|
||||||
|
install:
|
||||||
|
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
||||||
|
- rustup-init.exe -yv --default-toolchain %channel% --default-host %target%
|
||||||
|
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||||
|
- rustc -vV || true
|
||||||
|
- cargo -vV || true
|
||||||
|
|
||||||
|
build: false
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- cargo install --debug cargo-make
|
||||||
|
- cargo make ci-flow
|
2
docs/Gemfile
Executable file
2
docs/Gemfile
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
gem 'github-pages', group: :jekyll_plugins
|
5
docs/_config.yml
Executable file
5
docs/_config.yml
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
theme: jekyll-theme-cayman
|
||||||
|
title: duckscript
|
||||||
|
description: Simple, extendable and embeddable scripting language.
|
||||||
|
show_downloads: false
|
||||||
|
version: 0.1.0
|
14
docs/_includes/README.md
Executable file
14
docs/_includes/README.md
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
# duckscript
|
||||||
|
|
||||||
|
| duckscript | SDK | CLI |
|
||||||
|
| ----------- | ------- | ----------- |
|
||||||
|
| [![crates.io](https://img.shields.io/crates/v/duckscript.svg)](https://crates.io/crates/duckscript) | [![crates.io](https://img.shields.io/crates/v/duckscriptsdk.svg)](https://crates.io/crates/duckscriptsdk) | [![crates.io](https://img.shields.io/crates/v/duckscript_cli.svg)](https://crates.io/crates/duckscript_cli) |
|
||||||
|
| [![downloads](https://img.shields.io/crates/d/duckscript.svg)](https://crates.io/crates/duckscript) | [![downloads](https://img.shields.io/crates/d/duckscriptsdk.svg)](https://crates.io/crates/duckscriptsdk) | [![downloads](https://img.shields.io/crates/d/duckscript_cli.svg)](https://crates.io/crates/duckscript_cli) |
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/sagiegurari/duckscript.svg?branch=master)](http://travis-ci.org/sagiegurari/duckscript)
|
||||||
|
[![Build status](https://ci.appveyor.com/api/projects/status/github/sagiegurari/duckscript?branch=master&svg=true)](https://ci.appveyor.com/project/sagiegurari/duckscript)
|
||||||
|
[![codecov](https://codecov.io/gh/sagiegurari/duckscript/branch/master/graph/badge.svg)](https://codecov.io/gh/sagiegurari/duckscript)
|
||||||
|
[![license](https://img.shields.io/crates/l/duckscript.svg)](https://github.com/sagiegurari/duckscript/blob/master/LICENSE)
|
||||||
|
[![Built with cargo-make](https://sagiegurari.github.io/cargo-make/assets/badges/cargo-make.svg)](https://sagiegurari.github.io/cargo-make)
|
||||||
|
|
||||||
|
> Simple, extendable and embeddable scripting language.
|
460
docs/_includes/content.md
Executable file
460
docs/_includes/content.md
Executable file
|
@ -0,0 +1,460 @@
|
||||||
|
|
||||||
|
<a name="overview"></a>
|
||||||
|
## Overview
|
||||||
|
Duckscript is a simple, extendable and embeddable scripting language.<br>
|
||||||
|
The language itself has only few rules and most common language features are implemented as commands rather than part of the language itself.
|
||||||
|
|
||||||
|
<a name="lang-goals"></a>
|
||||||
|
### Language Goals
|
||||||
|
Duckscript scripting language goals are:
|
||||||
|
|
||||||
|
* Simple - This is probably the simplest language you will ever see.
|
||||||
|
* Extendable - Instead of having common features such as functions and conditional blocks be a part of the language, they are actually part of the API. So they can easily be replaced/modified or you can add more 'feature' like commands on your own.
|
||||||
|
* Embeddable - One of the main purposes of this language is to allow other libraries/executables/apps have scripting capability by embedding duckscript. Embedding is easy (for [rust](https://www.rust-lang.org/)) and requires only few lines of code.
|
||||||
|
|
||||||
|
<a name="installation"></a>
|
||||||
|
## Installation
|
||||||
|
If you have [rust](https://www.rust-lang.org/), just run the following command
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install --force duckscript_cli
|
||||||
|
```
|
||||||
|
|
||||||
|
This will install duckscript script runner, the standard duckscript SDK and the duckscript CLI.<br>
|
||||||
|
You should then have a **duckscript** executable in your ~/.cargo/bin directory.<br>
|
||||||
|
Make sure to add ~/.cargo/bin directory to your PATH variable.
|
||||||
|
|
||||||
|
<a name="installation-binary-release"></a>
|
||||||
|
### Binary Release
|
||||||
|
Binary releases are available in the [github releases page](https://github.com/sagiegurari/duckscript/releases).<br>
|
||||||
|
The following binaries are available for each release:
|
||||||
|
|
||||||
|
* x86_64-unknown-linux-musl
|
||||||
|
* x86_64-apple-darwin
|
||||||
|
* x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
<a name="tutorial"></a>
|
||||||
|
## Duckscript Tutorial
|
||||||
|
The following sections will teach you how to write and run duck scripts.
|
||||||
|
|
||||||
|
<a name="tutorial-hello-world"></a>
|
||||||
|
### Hello World Example
|
||||||
|
Let's take a really simple example (all examples are located in the [examples](https://github.com/sagiegurari/duckscript/tree/master/examples) directory:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo hello world
|
||||||
|
```
|
||||||
|
|
||||||
|
Running this script is done using the **duckscript** executable as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
duckscript ./examples/hello_world.ds
|
||||||
|
```
|
||||||
|
|
||||||
|
We will understand more and breakdown this down in the following sections.
|
||||||
|
|
||||||
|
<a name="tutorial-commands"></a>
|
||||||
|
### Commands
|
||||||
|
Commands are the basis of everything in duckscript.<br>
|
||||||
|
Commands may execute some action (like printing "hello world" to the console) or serve as flow control (such as functions or if/else conditions).<br>
|
||||||
|
In order to invoke an action, simply write the action name:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo
|
||||||
|
```
|
||||||
|
|
||||||
|
The basic syntax of a command line is:
|
||||||
|
|
||||||
|
```
|
||||||
|
[:label] [output variable =] [command [arguments]]
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-commands-passing-arguments"></a>
|
||||||
|
#### Passing Arguments
|
||||||
|
Commands may accept arguments, for example the command **echo** may accept any number of arguments and it will print all of them.<br>
|
||||||
|
Arguments are separated with the space character.<br>
|
||||||
|
So in the example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo hello world
|
||||||
|
```
|
||||||
|
|
||||||
|
The **echo** command got 2 arguments: "hello" and "world".<br>
|
||||||
|
If your argument contains a space, you can wrap the entire argument with the ```"``` character as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text "hello world"
|
||||||
|
echo "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
In which case the **echo** command got only one argument: "hello world" and prints it.<br>
|
||||||
|
You can escape the ```"``` character using the ```"\"``` character, for example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# print the text 'hello "world"'
|
||||||
|
echo "hello \"world\""
|
||||||
|
```
|
||||||
|
|
||||||
|
In the above example, the **echo** command got one argument: 'hello "world"' and prints it.<br>
|
||||||
|
The ```"\"``` is also used to escape the following:
|
||||||
|
|
||||||
|
* \n - End of line
|
||||||
|
* \r - Carriage return
|
||||||
|
* \t - Tab character
|
||||||
|
|
||||||
|
<a name="tutorial-commands-storing-output"></a>
|
||||||
|
#### Storing Output
|
||||||
|
Commands may return an output which can be stored in a variable.<br>
|
||||||
|
Variables in duckscript have no strict type.<br>
|
||||||
|
In the following example, the **set** command takes one argument and stores it in the **out** variable.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
out = set "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
Duckscript has only global scope, so once you have stored a value in a variable, you may use it anywhere in your script.
|
||||||
|
|
||||||
|
<a name="tutorial-commands-using-variables"></a>
|
||||||
|
#### Using Variables
|
||||||
|
Stored variables can be later on used as arguments for other commands.<br>
|
||||||
|
In order to use a variable, we need to wrap it as follows: ```${variable}```.<br>
|
||||||
|
<br>
|
||||||
|
The following example uses the **set** command to store a value in the **out** variable and then prints it:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
out = set "hello world"
|
||||||
|
|
||||||
|
# This will print: "The out variable holds the value: hello world"
|
||||||
|
echo The out variable holds the value: ${out}
|
||||||
|
|
||||||
|
# This will print: "To use the out variable just write: ${out}"
|
||||||
|
echo To use the out variable just write: \${out}
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, although **out** holds the value **hello world** which contains a space, it is still considered as a single input argument to the **echo** command.<br>
|
||||||
|
In the second echo command we prevented the variable name from being replaced by escaping it using the ```\``` character.
|
||||||
|
|
||||||
|
<a name="tutorial-labels"></a>
|
||||||
|
### Labels
|
||||||
|
Labels are simple textual names you can give to a specific line.<br>
|
||||||
|
Commands like **goto** can then be used to make the script execution jump from its current position to the label position.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
goto :good
|
||||||
|
|
||||||
|
echo error!!!!
|
||||||
|
|
||||||
|
:good echo yay!!!!
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-comments"></a>
|
||||||
|
### Comments
|
||||||
|
Comments are not executed and are simply in the code for documentation purposes.<br>
|
||||||
|
A document line must start with the ```#``` character.<br>
|
||||||
|
You can also have a comment after the command and the command will ignore it.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# This is just a comment
|
||||||
|
|
||||||
|
echo This will print # But this will not
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing"></a>
|
||||||
|
### Pre Processing
|
||||||
|
Pre processing is the phase that duckscript is parsing the script content.<br>
|
||||||
|
It is possible to run specific commands at that phase to modify the script during the parsing phase.<br>
|
||||||
|
|
||||||
|
The basic syntax of a pre processing command line is:
|
||||||
|
|
||||||
|
```
|
||||||
|
!command [arguments]
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing-including-files"></a>
|
||||||
|
#### !include_files
|
||||||
|
The include_files command enables you to load script files into the position of the pre processor command.<br>
|
||||||
|
Basically it enables you to include many scripts and generate one bigger script for runtime.<br>
|
||||||
|
The include files command accepts any number of files and all will be loaded by the order they are defined.<br>
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# load the hello_world.ds script here
|
||||||
|
!include_files ./hello_world.ds
|
||||||
|
|
||||||
|
# load 2 scripts here. The hello_world.ds is loaded again.
|
||||||
|
!include_files ./hello_world.ds ./use_variable.ds
|
||||||
|
```
|
||||||
|
|
||||||
|
Important to note that the script paths included are relative to the script file including them and not to the current working directory.
|
||||||
|
|
||||||
|
<a name="tutorial-pre-processing-including-files"></a>
|
||||||
|
#### !print
|
||||||
|
The print pre processing command allows to print any number of arguments, which could be useful for debugging.<br>
|
||||||
|
In the following example, although the print command comes after the echo command, it will execute first as it is invoked in the parsing phase and not in the script execution phase which comes later:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# this will print "hello world during script execution"
|
||||||
|
echo hello world during script execution
|
||||||
|
|
||||||
|
# this will print "hello world during parsing"
|
||||||
|
!print hello world during parsing
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api"></a>
|
||||||
|
### Standard API
|
||||||
|
Duckscript is split to several modules and while the script runner does not require it, by default it will come with the standard duckscript API called the duckscript SDK.<br>
|
||||||
|
This SDK holds the most common commands, some which execute actions (such as echo) and some which serve as flow control (such as function).<br>
|
||||||
|
The SDK enables users to develop their scripts and have a good starting point without the need to develop the commands on their own (as that is a bit more complex).
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api-commands-lang-features"></a>
|
||||||
|
#### Commands Instead Of Language Features
|
||||||
|
As mentioned before, duckscript is really simple and only has few basic rules.<br>
|
||||||
|
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.<br>
|
||||||
|
This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__Function):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
function print_first_and_second_argument
|
||||||
|
echo ${1} ${2}
|
||||||
|
return printed
|
||||||
|
end_function
|
||||||
|
|
||||||
|
function run_flow
|
||||||
|
status = print_first_and_second_argument hello world
|
||||||
|
echo The printout status is: ${status}
|
||||||
|
end_function
|
||||||
|
|
||||||
|
run_flow
|
||||||
|
```
|
||||||
|
|
||||||
|
This example demonstrates how functions as a concept do not need to be part of the language and can be implemented by anyone as a command.<br>
|
||||||
|
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.
|
||||||
|
|
||||||
|
Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__If):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
if set false
|
||||||
|
echo should not be here
|
||||||
|
elseif set true
|
||||||
|
echo in else if but not done yet
|
||||||
|
|
||||||
|
if set true
|
||||||
|
echo nested if
|
||||||
|
end_if
|
||||||
|
else
|
||||||
|
echo should not be here
|
||||||
|
end_if
|
||||||
|
```
|
||||||
|
|
||||||
|
Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__ForIn):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
range = array 1 2 3
|
||||||
|
|
||||||
|
for i in range
|
||||||
|
for j in range
|
||||||
|
echo i: ${i} j: ${j}
|
||||||
|
end_for
|
||||||
|
end_for
|
||||||
|
|
||||||
|
release range
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="tutorial-standard-api-full-sdk-docs"></a>
|
||||||
|
#### Full SDK Docs
|
||||||
|
The full SDK docs can be found [here](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md)
|
||||||
|
|
||||||
|
Keep in mind that the command names (such as **sdk::Echo**) can be used to invoke the commands, however for simplicity, the documentation
|
||||||
|
examples uses the alias form of the commands (for example: **echo**).<br>
|
||||||
|
Each command may have multiple aliases which can be used to invoke it.
|
||||||
|
|
||||||
|
<a name="tutorial-final-notes"></a>
|
||||||
|
### Final Notes
|
||||||
|
That's It!!!!<br>
|
||||||
|
That is all the language.<br>
|
||||||
|
Short, simple, only few rules to follow and you mastered duckscript.<br>
|
||||||
|
|
||||||
|
If you want to know what more you can do with it, look at the [SDK docs](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md).<br>
|
||||||
|
If you want to know how to write your own commands or embed the duckscript runtime in your application, continue reading.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial"></a>
|
||||||
|
## Duckscript Command Implementation Tutorial
|
||||||
|
Want to write new custom commands so you can use them in your duckscripts? great!<br>
|
||||||
|
Hopefully the following sections will help you gain the basic knowledge on how to write them.<br>
|
||||||
|
|
||||||
|
First of all it is important to understand that there are two types of commands:
|
||||||
|
|
||||||
|
* Commands which execute some action like copying files, printing some text to the console or returning an environment variable.
|
||||||
|
* Commands which provide flow control or some more complex action and require modifying the internal context in runtime.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial-standard-commands"></a>
|
||||||
|
## Standard Commands
|
||||||
|
Commands are structs that must implement the Command trait.<br>
|
||||||
|
They must have a name, which is used to invoke the command.<br>
|
||||||
|
They optionally may have aliases which can also be used too invoke the command.<br>
|
||||||
|
They should return help documentation in markdown in order to generate SDK documentation (must for PRs to duckscript SDK).<br>
|
||||||
|
And they must implement the **run** function which holds the command logic.<br>
|
||||||
|
|
||||||
|
The run function accepts the command arguments (variables already replaced to actual values) and returns the command result.<br>
|
||||||
|
The command result can be one of the following:
|
||||||
|
|
||||||
|
* Continue(Option<String>) - Tells the runner to continue to the next command and optionally set the output variable the given value.
|
||||||
|
* GoTo(Option<String>, GoToValue) - Tells the runner to jump to the requested line or label and optionally set the output variable the given value.
|
||||||
|
* Error(String) - Tells the runner to stop the exection and return the error message.
|
||||||
|
* Exit(Option<String>) - Tells the runner to stop the execution and optionally set the output variable the given value.
|
||||||
|
|
||||||
|
Let's implement a simple **set** command which accepts a single argument and sets the output variable to that value.<br>
|
||||||
|
And if no argument was provided, return a None which will tell the runner to delete the output variable.<br>
|
||||||
|
Afterwards the runner should continue to the next line.<br>
|
||||||
|
So we need to use a Continue(Option<String>) result.<br>
|
||||||
|
Full example:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
struct SetCommand {}
|
||||||
|
|
||||||
|
impl Command for SetCommand {
|
||||||
|
fn name(&self) -> String {
|
||||||
|
"set".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run(&self, arguments: Vec<String>) -> CommandResult {
|
||||||
|
let output = if arguments.is_empty() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(arguments[0].clone())
|
||||||
|
};
|
||||||
|
|
||||||
|
CommandResult::Continue(output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's implement a **get_env** command which pulls an environment variable value and sets the output variable with that value.<br>
|
||||||
|
In case no input was provided we will throw an error, otherwise we will use the first input as the environment variable key.<br>
|
||||||
|
We will return the value if exists or nothing if it does not.<br>
|
||||||
|
Full example:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
struct GetEnvCommand {
|
||||||
|
package: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Command for GetEnvCommand {
|
||||||
|
fn name(&self) -> String {
|
||||||
|
"get_env".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run(&self, arguments: Vec<String>) -> CommandResult {
|
||||||
|
if arguments.is_empty() {
|
||||||
|
CommandResult::Error("Missing environment variable name.".to_string())
|
||||||
|
} else {
|
||||||
|
match env::var(&arguments[0]) {
|
||||||
|
Ok(value) => CommandResult::Continue(Some(value)),
|
||||||
|
Err(_) => CommandResult::Continue(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can look at more examples in the duckscript_sdk folder.
|
||||||
|
|
||||||
|
<a name="sdk-tutorial-context-commands"></a>
|
||||||
|
## Context Commands
|
||||||
|
Context commands are exactly the same as standard commands except that they have access to the runtime context.<br>
|
||||||
|
Therefore they implement the same Command trait but this time instead of implementing the run function, they need to implement the following:
|
||||||
|
|
||||||
|
* requires_context - Must return true
|
||||||
|
* run_with_context - The same logic you would put in the run function but now you have access to a lot more of the runtime context.
|
||||||
|
|
||||||
|
The run_with_context signature is as follows:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
/// Run the instruction with access to the runtime context.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `arguments` - The command arguments array
|
||||||
|
/// * `state` - Internal state which is only used by commands to store/pull data
|
||||||
|
/// * `variables` - All script variables
|
||||||
|
/// * `output_variable` - The output variable name (if defined)
|
||||||
|
/// * `instructions` - The entire list of instructions which make up the currently running script
|
||||||
|
/// * `commands` - The currently known commands
|
||||||
|
/// * `line` - The current instruction line number (global line number after including all scripts into one global script)
|
||||||
|
fn run_with_context(
|
||||||
|
&self,
|
||||||
|
arguments: Vec<String>,
|
||||||
|
state: &mut HashMap<String, StateValue>,
|
||||||
|
variables: &mut HashMap<String, String>,
|
||||||
|
output_variable: Option<String>,
|
||||||
|
instructions: &Vec<Instruction>,
|
||||||
|
commands: &mut Commands,
|
||||||
|
line: usize,
|
||||||
|
) -> CommandResult;
|
||||||
|
```
|
||||||
|
|
||||||
|
With access to this context you can add/remove/switch commands in runtime, store/pull internal state, add/remove/change variables and so on...
|
||||||
|
|
||||||
|
<a name="embed-tutorial"></a>
|
||||||
|
## Duckscript Embedding Tutorial
|
||||||
|
Embedding duckscript is really simple and this is one of the language main goals.<br>
|
||||||
|
The duckscript cli basically embeds duckscript so you can look at it as a reference, but basically it boils down to really few lines of code:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
let mut context = Context::new();
|
||||||
|
duckscriptsdk::load(&mut context.commands)?;
|
||||||
|
runner::run_script_file(file, context)?;
|
||||||
|
```
|
||||||
|
|
||||||
|
That's it!<br>
|
||||||
|
Unless you want to provide your own custom SDK, prepopulate the runtime context with custom variables/state or
|
||||||
|
pull information out of the context after invocation than those 3 lines of code is all you need to do.<br>
|
||||||
|
Let's go over it line by line.<br>
|
||||||
|
|
||||||
|
<a name="embed-tutorial-setup-context"></a>
|
||||||
|
## Setting Up The Context
|
||||||
|
The context holds the initial known commands, variables and state (internal objects used by commands).<br>
|
||||||
|
Running the ```Context::new()``` simply creates a new empty context.<br>
|
||||||
|
You can add to it any command, variable or state object you want before running the scripts.<br>
|
||||||
|
In our example we load all default standard API commands into the new context via: ```duckscriptsdk::load(&mut context.commands)?;```
|
||||||
|
|
||||||
|
<a name="embed-tutorial-running"></a>
|
||||||
|
## Running The Script
|
||||||
|
After we have a context setup, we will run the script.<br>
|
||||||
|
The **runner** enables to run a script text or a script file.<br>
|
||||||
|
The following public functions are available:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
/// Executes the provided script with the given context
|
||||||
|
pub fn run_script(text: &str, context: Context) -> Result<Context, ScriptError>;
|
||||||
|
|
||||||
|
/// Executes the provided script file with the given context
|
||||||
|
pub fn run_script_file(file: &str, context: Context) -> Result<Context, ScriptError>;
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="contributing"></a>
|
||||||
|
## Contributing
|
||||||
|
There are many ways to contribute to duckscript, including:
|
||||||
|
|
||||||
|
* Writing more commands and adding them to the standard SDK
|
||||||
|
* Improving existing commands by adding more features
|
||||||
|
* Improving the documentation
|
||||||
|
* Opening issues with new feature requests or bugs found
|
||||||
|
* Spreading the word :)
|
||||||
|
|
||||||
|
As for expanding the language, I personally prefer not to make it complex.<br>
|
||||||
|
Let's try to add more language feature using commands and not changing the language itself.<br>
|
||||||
|
|
||||||
|
See [contributing guide](https://github.com/sagiegurari/duckscript/blob/master/.github/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
<a name="history"></a>
|
||||||
|
## Release History
|
||||||
|
|
||||||
|
See [Changelog](https://github.com/sagiegurari/duckscript/blob/master/CHANGELOG.md)
|
||||||
|
|
||||||
|
<a name="license"></a>
|
||||||
|
## License
|
||||||
|
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.
|
4
docs/_includes/main.html
Executable file
4
docs/_includes/main.html
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="site">
|
||||||
|
<nav class="site-nav" markdown="1">{% include nav.md %}</nav>
|
||||||
|
<div class="site-content" markdown="1">{% include content.md %}</div>
|
||||||
|
</div>
|
29
docs/_includes/nav.md
Executable file
29
docs/_includes/nav.md
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
* [Overview](#overview)
|
||||||
|
* [Language Goals](#lang-goals)
|
||||||
|
* [Installation](#installation)
|
||||||
|
* [Binary Release](#installation-binary-release)
|
||||||
|
* [Duckscript Tutorial](#tutorial)
|
||||||
|
* [Hello World Example](#tutorial-hello-world)
|
||||||
|
* [Commands](#tutorial-commands)
|
||||||
|
* [Passing Arguments](#tutorial-commands-passing-arguments)
|
||||||
|
* [Storing Output](#tutorial-commands-storing-output)
|
||||||
|
* [Using Variables](#tutorial-commands-using-variables)
|
||||||
|
* [Labels](#tutorial-labels)
|
||||||
|
* [Comments](#tutorial-comments)
|
||||||
|
* [Pre Processing](#tutorial-pre-processing)
|
||||||
|
* [!include_files](#tutorial-pre-processing-including-files)
|
||||||
|
* [!print](#tutorial-pre-processing-printout)
|
||||||
|
* [Standard API](#tutorial-standard-api)
|
||||||
|
* [Commands Instead Of Language Features](#tutorial-standard-api-commands-lang-features)
|
||||||
|
* [Full SDK Docs](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md)
|
||||||
|
* [Final Notes](#tutorial-final-notes)
|
||||||
|
* [Duckscript Command Implementation Tutorial](#sdk-tutorial)
|
||||||
|
* [Standard Commands](#sdk-tutorial-standard-commands)
|
||||||
|
* [Context Commands](#sdk-tutorial-context-commands)
|
||||||
|
* [Duckscript Embedding Tutorial](#embed-tutorial)
|
||||||
|
* [Setting Up The Context](#embed-tutorial-setup-context)
|
||||||
|
* [Running The Script](#embed-tutorial-running)
|
||||||
|
* [Contributing](#contributing)
|
||||||
|
* [Release History](https://github.com/sagiegurari/duckscript/blob/master/CHANGELOG.md)
|
||||||
|
* [License](#license)
|
9
docs/api.html
Executable file
9
docs/api.html
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="Author" content="Sagie Gur-Ari">
|
||||||
|
<meta http-equiv="refresh" content="0; url=./api/duckscript/index.html">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
45
docs/api/duckscript/COPYRIGHT.txt
Normal file
45
docs/api/duckscript/COPYRIGHT.txt
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
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.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.woff, SourceCodePro-Semibold.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 Pro (SourceSerifPro-Regular.ttf.woff,
|
||||||
|
SourceSerifPro-Bold.ttf.woff, SourceSerifPro-It.ttf.woff):
|
||||||
|
|
||||||
|
Copyright 2014 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 SourceSerifPro-LICENSE.txt.
|
||||||
|
|
||||||
|
This copyright file is intended to be distributed with rustdoc output.
|
94
docs/api/duckscript/FiraSans-LICENSE.txt
Normal file
94
docs/api/duckscript/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
docs/api/duckscript/FiraSans-Medium.woff
Normal file
BIN
docs/api/duckscript/FiraSans-Medium.woff
Normal file
Binary file not shown.
BIN
docs/api/duckscript/FiraSans-Regular.woff
Normal file
BIN
docs/api/duckscript/FiraSans-Regular.woff
Normal file
Binary file not shown.
201
docs/api/duckscript/LICENSE-APACHE.txt
Normal file
201
docs/api/duckscript/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
docs/api/duckscript/LICENSE-MIT.txt
Normal file
23
docs/api/duckscript/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.
|
93
docs/api/duckscript/SourceCodePro-LICENSE.txt
Normal file
93
docs/api/duckscript/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
docs/api/duckscript/SourceCodePro-Regular.woff
Normal file
BIN
docs/api/duckscript/SourceCodePro-Regular.woff
Normal file
Binary file not shown.
BIN
docs/api/duckscript/SourceCodePro-Semibold.woff
Normal file
BIN
docs/api/duckscript/SourceCodePro-Semibold.woff
Normal file
Binary file not shown.
BIN
docs/api/duckscript/SourceSerifPro-Bold.ttf.woff
Normal file
BIN
docs/api/duckscript/SourceSerifPro-Bold.ttf.woff
Normal file
Binary file not shown.
BIN
docs/api/duckscript/SourceSerifPro-It.ttf.woff
Normal file
BIN
docs/api/duckscript/SourceSerifPro-It.ttf.woff
Normal file
Binary file not shown.
93
docs/api/duckscript/SourceSerifPro-LICENSE.md
Normal file
93
docs/api/duckscript/SourceSerifPro-LICENSE.md
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
Copyright 2014-2018 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
docs/api/duckscript/SourceSerifPro-Regular.ttf.woff
Normal file
BIN
docs/api/duckscript/SourceSerifPro-Regular.ttf.woff
Normal file
Binary file not shown.
2
docs/api/duckscript/aliases.js
Normal file
2
docs/api/duckscript/aliases.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
var ALIASES = {};
|
||||||
|
ALIASES["duckscript"] = {};
|
1
docs/api/duckscript/brush.svg
Normal file
1
docs/api/duckscript/brush.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" ?><svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><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: 477 B |
1
docs/api/duckscript/dark.css
Normal file
1
docs/api/duckscript/dark.css
Normal file
File diff suppressed because one or more lines are too long
1
docs/api/duckscript/down-arrow.svg
Normal file
1
docs/api/duckscript/down-arrow.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="128px" id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="-30 -20 176 176" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="111" x2="64" y1="40.5" y2="87.499"/><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="64" x2="17" y1="87.499" y2="40.5"/></g></svg>
|
After Width: | Height: | Size: 641 B |
3
docs/api/duckscript/duckscript/all.html
Normal file
3
docs/api/duckscript/duckscript/all.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!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="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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../duckscript/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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>
|
||||||
|
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='types/command/struct.Commands.html'>types::command::Commands</a></li><li><a href='types/error/struct.ScriptError.html'>types::error::ScriptError</a></li><li><a href='types/instruction/struct.Instruction.html'>types::instruction::Instruction</a></li><li><a href='types/instruction/struct.InstructionMetaInfo.html'>types::instruction::InstructionMetaInfo</a></li><li><a href='types/instruction/struct.PreProcessInstruction.html'>types::instruction::PreProcessInstruction</a></li><li><a href='types/instruction/struct.ScriptInstruction.html'>types::instruction::ScriptInstruction</a></li><li><a href='types/runtime/struct.Context.html'>types::runtime::Context</a></li><li><a href='types/runtime/struct.Runtime.html'>types::runtime::Runtime</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='types/command/enum.CommandResult.html'>types::command::CommandResult</a></li><li><a href='types/command/enum.GoToValue.html'>types::command::GoToValue</a></li><li><a href='types/error/enum.ErrorInfo.html'>types::error::ErrorInfo</a></li><li><a href='types/instruction/enum.InstructionType.html'>types::instruction::InstructionType</a></li><li><a href='types/runtime/enum.StateValue.html'>types::runtime::StateValue</a></li></ul><h3 id='Traits'>Traits</h3><ul class='traits docblock'><li><a href='types/command/trait.Command.html'>types::command::Command</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='parser/fn.parse_file.html'>parser::parse_file</a></li><li><a href='parser/fn.parse_text.html'>parser::parse_text</a></li><li><a href='runner/fn.run_script.html'>runner::run_script</a></li><li><a href='runner/fn.run_script_file.html'>runner::run_script_file</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "duckscript";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
19
docs/api/duckscript/duckscript/index.html
Normal file
19
docs/api/duckscript/duckscript/index.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="API documentation for the Rust `duckscript` crate."><meta name="keywords" content="rust, rustlang, rust-lang, duckscript"><title>duckscript - Rust</title><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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../duckscript/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate duckscript</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all duckscript's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'duckscript', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/lib.rs.html#1-133' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>duckscript</a></span></h1><div class='docblock'><h1 id="duckscript" class="section-header"><a href="#duckscript">duckscript</a></h1>
|
||||||
|
<p>Simple, extendable and embeddable scripting language.</p>
|
||||||
|
<p>This library is the actual script parser and runner.<br>
|
||||||
|
On it's own, it has no actual commands as those need to be provided externally (see duckscript_sdk).</p>
|
||||||
|
<h1 id="installation" class="section-header"><a href="#installation">Installation</a></h1>
|
||||||
|
<p>In order to use this library, just add it as a dependency:</p>
|
||||||
|
<pre><code class="language-ini">[dependencies]
|
||||||
|
duckscript = "*"
|
||||||
|
</code></pre>
|
||||||
|
<h1 id="contributing" class="section-header"><a href="#contributing">Contributing</a></h1>
|
||||||
|
<p>See <a href="https://github.com/sagiegurari/duckscript/blob/master/.github/CONTRIBUTING.md">contributing guide</a></p>
|
||||||
|
<h1 id="license" class="section-header"><a href="#license">License</a></h1>
|
||||||
|
<p>Developed by Sagie Gur-Ari and licensed under the
|
||||||
|
<a href="https://github.com/sagiegurari/duckscript/blob/master/LICENSE">Apache 2</a> open source license.</p>
|
||||||
|
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="mod" href="parser/index.html" title='duckscript::parser mod'>parser</a></td><td class='docblock-short'><p>parser</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="mod" href="runner/index.html" title='duckscript::runner mod'>runner</a></td><td class='docblock-short'><p>runner</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="mod" href="types/index.html" title='duckscript::types mod'>types</a></td><td class='docblock-short'><p>types</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "duckscript";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
2
docs/api/duckscript/duckscript/parser/fn.parse_file.html
Normal file
2
docs/api/duckscript/duckscript/parser/fn.parse_file.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!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 `parse_file` fn in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, parse_file"><title>duckscript::parser::parse_file - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>parser</a></p><script>window.sidebarCurrent = {name: 'parse_file', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/parser.rs.html#22-30' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>parser</a>::<wbr><a class="fn" href=''>parse_file</a></span></h1><pre class='rust fn'>pub fn parse_file(file: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>, <a class="struct" href="../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a>></pre><div class='docblock'><p>parses the file and returns a vector of instructions</p>
|
||||||
|
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
2
docs/api/duckscript/duckscript/parser/fn.parse_text.html
Normal file
2
docs/api/duckscript/duckscript/parser/fn.parse_text.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!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 `parse_text` fn in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, parse_text"><title>duckscript::parser::parse_text - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>parser</a></p><script>window.sidebarCurrent = {name: 'parse_text', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/parser.rs.html#33-35' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>parser</a>::<wbr><a class="fn" href=''>parse_text</a></span></h1><pre class='rust fn'>pub fn parse_text(text: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>, <a class="struct" href="../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a>></pre><div class='docblock'><p>parses the provided script text and returns a vector of instructions</p>
|
||||||
|
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
6
docs/api/duckscript/duckscript/parser/index.html
Normal file
6
docs/api/duckscript/duckscript/parser/index.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="API documentation for the Rust `parser` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, parser"><title>duckscript::parser - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module parser</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>duckscript</a></p><script>window.sidebarCurrent = {name: 'parser', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/parser.rs.html#1-444' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>duckscript</a>::<wbr><a class="mod" href=''>parser</a></span></h1><div class='docblock'><h1 id="parser" class="section-header"><a href="#parser">parser</a></h1>
|
||||||
|
<p>The duck script parser.</p>
|
||||||
|
</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="fn" href="fn.parse_file.html" title='duckscript::parser::parse_file fn'>parse_file</a></td><td class='docblock-short'><p>parses the file and returns a vector of instructions</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.parse_text.html" title='duckscript::parser::parse_text fn'>parse_text</a></td><td class='docblock-short'><p>parses the provided script text and returns a vector of instructions</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
1
docs/api/duckscript/duckscript/parser/sidebar-items.js
Normal file
1
docs/api/duckscript/duckscript/parser/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"fn":[["parse_file","parses the file and returns a vector of instructions"],["parse_text","parses the provided script text and returns a vector of instructions"]]});
|
2
docs/api/duckscript/duckscript/runner/fn.run_script.html
Normal file
2
docs/api/duckscript/duckscript/runner/fn.run_script.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<!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 `run_script` fn in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, run_script"><title>duckscript::runner::run_script - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>runner</a></p><script>window.sidebarCurrent = {name: 'run_script', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/runner.rs.html#19-24' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>runner</a>::<wbr><a class="fn" href=''>run_script</a></span></h1><pre class='rust fn'>pub fn run_script(text: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, context: <a class="struct" href="../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a>, <a class="struct" href="../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a>></pre><div class='docblock'><p>Executes the provided script with the given context</p>
|
||||||
|
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!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 `run_script_file` fn in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, run_script_file"><title>duckscript::runner::run_script_file - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>runner</a></p><script>window.sidebarCurrent = {name: 'run_script_file', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/runner.rs.html#27-32' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>duckscript</a>::<wbr><a href='index.html'>runner</a>::<wbr><a class="fn" href=''>run_script_file</a></span></h1><pre class='rust fn'>pub fn run_script_file(<br> file: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> context: <a class="struct" href="../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a>, <a class="struct" href="../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a>></pre><div class='docblock'><p>Executes the provided script file with the given context</p>
|
||||||
|
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
6
docs/api/duckscript/duckscript/runner/index.html
Normal file
6
docs/api/duckscript/duckscript/runner/index.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="API documentation for the Rust `runner` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, runner"><title>duckscript::runner - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module runner</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>duckscript</a></p><script>window.sidebarCurrent = {name: 'runner', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/runner.rs.html#1-218' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>duckscript</a>::<wbr><a class="mod" href=''>runner</a></span></h1><div class='docblock'><h1 id="runner" class="section-header"><a href="#runner">runner</a></h1>
|
||||||
|
<p>The main entry point which enables running scripts.</p>
|
||||||
|
</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="fn" href="fn.run_script.html" title='duckscript::runner::run_script fn'>run_script</a></td><td class='docblock-short'><p>Executes the provided script with the given context</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.run_script_file.html" title='duckscript::runner::run_script_file fn'>run_script_file</a></td><td class='docblock-short'><p>Executes the provided script file with the given context</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
1
docs/api/duckscript/duckscript/runner/sidebar-items.js
Normal file
1
docs/api/duckscript/duckscript/runner/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"fn":[["run_script","Executes the provided script with the given context"],["run_script_file","Executes the provided script file with the given context"]]});
|
1
docs/api/duckscript/duckscript/sidebar-items.js
Normal file
1
docs/api/duckscript/duckscript/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"mod":[["parser","parser"],["runner","runner"],["types","types"]]});
|
|
@ -0,0 +1,29 @@
|
||||||
|
<!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 `CommandResult` enum in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, CommandResult"><title>duckscript::types::command::CommandResult - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum CommandResult</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Continue">Continue</a><a href="#variant.GoTo">GoTo</a><a href="#variant.Error">Error</a><a href="#variant.Exit">Exit</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a></p><script>window.sidebarCurrent = {name: 'CommandResult', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/command.rs.html#26-35' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a>::<wbr><a class="enum" href=''>CommandResult</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum CommandResult {
|
||||||
|
Continue(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>),
|
||||||
|
GoTo(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a>),
|
||||||
|
Error(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
||||||
|
Exit(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>),
|
||||||
|
}</pre></div><div class='docblock'><p>Command execution result</p>
|
||||||
|
</div><h2 id='variants' class='variants small-section-header'>
|
||||||
|
Variants<a href='#variants' class='anchor'></a></h2>
|
||||||
|
<span id="variant.Continue" class="variant small-section-header"><a href="#variant.Continue" class="anchor field"></a><code id='Continue.v'>Continue(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>)</code></span><div class='docblock'><p>Holds the command output and tells the runner to continue to next instruction</p>
|
||||||
|
</div><span id="variant.GoTo" class="variant small-section-header"><a href="#variant.GoTo" class="anchor field"></a><code id='GoTo.v'>GoTo(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a>)</code></span><div class='docblock'><p>Holds the command output and tells the runner to jump to the provided label</p>
|
||||||
|
</div><span id="variant.Error" class="variant small-section-header"><a href="#variant.Error" class="anchor field"></a><code id='Error.v'>Error(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span><div class='docblock'><p>Holds the error message and the meta info of the instruction that caused it</p>
|
||||||
|
</div><span id="variant.Exit" class="variant small-section-header"><a href="#variant.Exit" class="anchor field"></a><code id='Exit.v'>Exit(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>)</code></span><div class='docblock'><p>Holds the command output and tells the runner to stop the script execution</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/command.rs.html#25' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#25' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/command.rs.html#25' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#25' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!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 `GoToValue` enum in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, GoToValue"><title>duckscript::types::command::GoToValue - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum GoToValue</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Label">Label</a><a href="#variant.Line">Line</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a></p><script>window.sidebarCurrent = {name: 'GoToValue', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/command.rs.html#17-22' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a>::<wbr><a class="enum" href=''>GoToValue</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum GoToValue {
|
||||||
|
Label(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
||||||
|
Line(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
|
||||||
|
}</pre></div><div class='docblock'><p>GoTo type value</p>
|
||||||
|
</div><h2 id='variants' class='variants small-section-header'>
|
||||||
|
Variants<a href='#variants' class='anchor'></a></h2>
|
||||||
|
<span id="variant.Label" class="variant small-section-header"><a href="#variant.Label" class="anchor field"></a><code id='Label.v'>Label(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span><div class='docblock'><p>label target</p>
|
||||||
|
</div><span id="variant.Line" class="variant small-section-header"><a href="#variant.Line" class="anchor field"></a><code id='Line.v'>Line(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></span><div class='docblock'><p>Line number</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/command.rs.html#16' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#16' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/command.rs.html#16' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#16' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../duckscript/types/command/enum.GoToValue.html" title="enum duckscript::types::command::GoToValue">GoToValue</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
10
docs/api/duckscript/duckscript/types/command/index.html
Normal file
10
docs/api/duckscript/duckscript/types/command/index.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!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 `command` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, command"><title>duckscript::types::command - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module command</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a></p><script>window.sidebarCurrent = {name: 'command', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/command.rs.html#1-174' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a class="mod" href=''>command</a></span></h1><div class='docblock'><h1 id="command" class="section-header"><a href="#command">command</a></h1>
|
||||||
|
<p>The command trait and access module.</p>
|
||||||
|
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="struct" href="struct.Commands.html" title='duckscript::types::command::Commands struct'>Commands</a></td><td class='docblock-short'><p>Holds and enables access to the runtime commands implementations</p>
|
||||||
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="enum" href="enum.CommandResult.html" title='duckscript::types::command::CommandResult enum'>CommandResult</a></td><td class='docblock-short'><p>Command execution result</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="enum" href="enum.GoToValue.html" title='duckscript::types::command::GoToValue enum'>GoToValue</a></td><td class='docblock-short'><p>GoTo type value</p>
|
||||||
|
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="trait" href="trait.Command.html" title='duckscript::types::command::Command trait'>Command</a></td><td class='docblock-short'><p>Defines the command capabilities</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"enum":[["CommandResult","Command execution result"],["GoToValue","GoTo type value"]],"struct":[["Commands","Holds and enables access to the runtime commands implementations"]],"trait":[["Command","Defines the command capabilities"]]});
|
|
@ -0,0 +1,26 @@
|
||||||
|
<!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 `Commands` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, Commands"><title>duckscript::types::command::Commands - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Commands</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.commands">commands</a><a href="#structfield.aliases">aliases</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.get">get</a><a href="#method.get_all_command_names">get_all_command_names</a><a href="#method.get_for_use">get_for_use</a><a href="#method.new">new</a><a href="#method.return_after_usage">return_after_usage</a><a href="#method.set">set</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a></p><script>window.sidebarCurrent = {name: 'Commands', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/command.rs.html#79-84' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a>::<wbr><a class="struct" href=''>Commands</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Commands {
|
||||||
|
pub commands: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>>,
|
||||||
|
pub aliases: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
}</pre></div><div class='docblock'><p>Holds and enables access to the runtime commands implementations</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.commands" class="structfield small-section-header"><a href="#structfield.commands" class="anchor field"></a><code id="commands.v">commands: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>></code></span><div class='docblock'><p>mapping between command names to implementations</p>
|
||||||
|
</div><span id="structfield.aliases" class="structfield small-section-header"><a href="#structfield.aliases" class="anchor field"></a><code id="aliases.v">aliases: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>mapping between aliases to command names</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/command.rs.html#86-174' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#88-93' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div><h4 id='method.return_after_usage' class="method"><code id='return_after_usage.v'>pub fn <a href='#method.return_after_usage' class='fnname'>return_after_usage</a>(&mut self, command: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>)</code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#97-101' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the command after it was being used.
|
||||||
|
No validations will be made.</p>
|
||||||
|
</div><h4 id='method.set' class="method"><code id='set.v'>pub fn <a href='#method.set' class='fnname'>set</a>(&mut self, command: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a>></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#105-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds a new command definition.
|
||||||
|
It will fail in case another command already defined the same name/aliases</p>
|
||||||
|
</div><h4 id='method.get' class="method"><code id='get.v'>pub fn <a href='#method.get' class='fnname'>get</a>(&self, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#136-146' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the command based on the given command name/alias</p>
|
||||||
|
</div><h4 id='method.get_for_use' class="method"><code id='get_for_use.v'>pub fn <a href='#method.get_for_use' class='fnname'>get_for_use</a>(&mut self, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../duckscript/types/command/trait.Command.html" title="trait duckscript::types::command::Command">Command</a>>></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#150-160' title='goto source code'>[src]</a></h4><div class='docblock'><p>Return the command based on the given command name/alias.
|
||||||
|
It will also remove it in the process.</p>
|
||||||
|
</div><h4 id='method.get_all_command_names' class="method"><code id='get_all_command_names.v'>pub fn <a href='#method.get_all_command_names' class='fnname'>get_all_command_names</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code><a class='srclink' href='../../../src/duckscript/types/command.rs.html#163-173' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns all the command names currently registered</p>
|
||||||
|
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,21 @@
|
||||||
|
<!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 `Command` trait in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, Command"><title>duckscript::types::command::Command - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Command</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.name">name</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.aliases">aliases</a><a href="#method.help">help</a><a href="#method.requires_context">requires_context</a><a href="#method.run">run</a><a href="#method.run_with_context">run_with_context</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a></p><script>window.sidebarCurrent = {name: 'Command', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/command.rs.html#38-76' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>command</a>::<wbr><a class="trait" href=''>Command</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Command {
|
||||||
|
fn <a href='#tymethod.name' class='fnname'>name</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>;
|
||||||
|
|
||||||
|
fn <a href='#method.aliases' class='fnname'>aliases</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> { ... }
|
||||||
|
<div class='item-spacer'></div> fn <a href='#method.help' class='fnname'>help</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> { ... }
|
||||||
|
<div class='item-spacer'></div> fn <a href='#method.requires_context' class='fnname'>requires_context</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||||
|
<div class='item-spacer'></div> fn <a href='#method.run' class='fnname'>run</a>(&self, _arguments: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a> { ... }
|
||||||
|
<div class='item-spacer'></div> fn <a href='#method.run_with_context' class='fnname'>run_with_context</a>(<br> &self, <br> _arguments: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _state: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>, <br> _variables: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _output_variable: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _instructions: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>, <br> _commands: &mut <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a>, <br> _meta_info: <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>, <br> _line: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br> ) -> <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a> { ... }
|
||||||
|
}</pre></div><div class='docblock'><p>Defines the command capabilities</p>
|
||||||
|
</div>
|
||||||
|
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.name' class='method'><code id='name.v'>fn <a href='#tymethod.name' class='fnname'>name</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h3><div class='docblock'><p>The full command name which can be used to invoke this command</p>
|
||||||
|
</div></div><span class='loading-content'>Loading content...</span>
|
||||||
|
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.aliases' class='method'><code id='aliases.v'>fn <a href='#method.aliases' class='fnname'>aliases</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></h3><div class='docblock'><p>A list of aliases that can also be used to invoke this command</p>
|
||||||
|
</div><h3 id='method.help' class='method'><code id='help.v'>fn <a href='#method.help' class='fnname'>help</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h3><div class='docblock'><p>Command documentation</p>
|
||||||
|
</div><h3 id='method.requires_context' class='method'><code id='requires_context.v'>fn <a href='#method.requires_context' class='fnname'>requires_context</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3><div class='docblock'><p>If true the run with the context will be invoked</p>
|
||||||
|
</div><h3 id='method.run' class='method'><code id='run.v'>fn <a href='#method.run' class='fnname'>run</a>(&self, _arguments: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>) -> <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code></h3><div class='docblock'><p>Runs the given instruction</p>
|
||||||
|
</div><h3 id='method.run_with_context' class='method'><code id='run_with_context.v'>fn <a href='#method.run_with_context' class='fnname'>run_with_context</a>(<br> &self, <br> _arguments: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _state: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>, <br> _variables: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _output_variable: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, <br> _instructions: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>, <br> _commands: &mut <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a>, <br> _meta_info: <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>, <br> _line: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br>) -> <a class="enum" href="../../../duckscript/types/command/enum.CommandResult.html" title="enum duckscript::types::command::CommandResult">CommandResult</a></code></h3><div class='docblock'><p>Run the instruction with access to the runtime context</p>
|
||||||
|
</div></div><span class='loading-content'>Loading content...</span>
|
||||||
|
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
|
||||||
|
src="../../../implementors/duckscript/types/command/trait.Command.js">
|
||||||
|
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<!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 `ErrorInfo` enum in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, ErrorInfo"><title>duckscript::types::error::ErrorInfo - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum ErrorInfo</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.ErrorReadingFile">ErrorReadingFile</a><a href="#variant.Initialization">Initialization</a><a href="#variant.Runtime">Runtime</a><a href="#variant.PreProcessNoCommandFound">PreProcessNoCommandFound</a><a href="#variant.ControlWithoutValidValue">ControlWithoutValidValue</a><a href="#variant.InvalidControlLocation">InvalidControlLocation</a><a href="#variant.MissingEndQuotes">MissingEndQuotes</a><a href="#variant.MissingOutputVariableName">MissingOutputVariableName</a><a href="#variant.InvalidEqualsLocation">InvalidEqualsLocation</a><a href="#variant.InvalidQuotesLocation">InvalidQuotesLocation</a><a href="#variant.EmptyLabel">EmptyLabel</a><a href="#variant.UnknownPreProcessorCommand">UnknownPreProcessorCommand</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>error</a></p><script>window.sidebarCurrent = {name: 'ErrorInfo', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/error.rs.html#34-59' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>error</a>::<wbr><a class="enum" href=''>ErrorInfo</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum ErrorInfo {
|
||||||
|
ErrorReadingFile(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>>),
|
||||||
|
Initialization(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
||||||
|
Runtime(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>>),
|
||||||
|
PreProcessNoCommandFound(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
ControlWithoutValidValue(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
InvalidControlLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
MissingEndQuotes(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
MissingOutputVariableName(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
InvalidEqualsLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
InvalidQuotesLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
EmptyLabel(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
UnknownPreProcessorCommand(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>),
|
||||||
|
}</pre></div><div class='docblock'><p>Holds the error information</p>
|
||||||
|
</div><h2 id='variants' class='variants small-section-header'>
|
||||||
|
Variants<a href='#variants' class='anchor'></a></h2>
|
||||||
|
<span id="variant.ErrorReadingFile" class="variant small-section-header"><a href="#variant.ErrorReadingFile" class="anchor field"></a><code id='ErrorReadingFile.v'>ErrorReadingFile(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.Initialization" class="variant small-section-header"><a href="#variant.Initialization" class="anchor field"></a><code id='Initialization.v'>Initialization(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.Runtime" class="variant small-section-header"><a href="#variant.Runtime" class="anchor field"></a><code id='Runtime.v'>Runtime(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.PreProcessNoCommandFound" class="variant small-section-header"><a href="#variant.PreProcessNoCommandFound" class="anchor field"></a><code id='PreProcessNoCommandFound.v'>PreProcessNoCommandFound(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.ControlWithoutValidValue" class="variant small-section-header"><a href="#variant.ControlWithoutValidValue" class="anchor field"></a><code id='ControlWithoutValidValue.v'>ControlWithoutValidValue(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.InvalidControlLocation" class="variant small-section-header"><a href="#variant.InvalidControlLocation" class="anchor field"></a><code id='InvalidControlLocation.v'>InvalidControlLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.MissingEndQuotes" class="variant small-section-header"><a href="#variant.MissingEndQuotes" class="anchor field"></a><code id='MissingEndQuotes.v'>MissingEndQuotes(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.MissingOutputVariableName" class="variant small-section-header"><a href="#variant.MissingOutputVariableName" class="anchor field"></a><code id='MissingOutputVariableName.v'>MissingOutputVariableName(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.InvalidEqualsLocation" class="variant small-section-header"><a href="#variant.InvalidEqualsLocation" class="anchor field"></a><code id='InvalidEqualsLocation.v'>InvalidEqualsLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.InvalidQuotesLocation" class="variant small-section-header"><a href="#variant.InvalidQuotesLocation" class="anchor field"></a><code id='InvalidQuotesLocation.v'>InvalidQuotesLocation(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.EmptyLabel" class="variant small-section-header"><a href="#variant.EmptyLabel" class="anchor field"></a><code id='EmptyLabel.v'>EmptyLabel(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><span id="variant.UnknownPreProcessorCommand" class="variant small-section-header"><a href="#variant.UnknownPreProcessorCommand" class="anchor field"></a><code id='UnknownPreProcessorCommand.v'>UnknownPreProcessorCommand(<a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>)</code></span><div class='docblock'><p>Error Info Type</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/error.rs.html#32' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/error.rs.html#32' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
7
docs/api/duckscript/duckscript/types/error/index.html
Normal file
7
docs/api/duckscript/duckscript/types/error/index.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!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 `error` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, error"><title>duckscript::types::error - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module error</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a></p><script>window.sidebarCurrent = {name: 'error', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/error.rs.html#1-116' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a class="mod" href=''>error</a></span></h1><div class='docblock'><h1 id="error" class="section-header"><a href="#error">error</a></h1>
|
||||||
|
<p>The error structure and types.</p>
|
||||||
|
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="struct" href="struct.ScriptError.html" title='duckscript::types::error::ScriptError struct'>ScriptError</a></td><td class='docblock-short'><p>Script error struct</p>
|
||||||
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="enum" href="enum.ErrorInfo.html" title='duckscript::types::error::ErrorInfo enum'>ErrorInfo</a></td><td class='docblock-short'><p>Holds the error information</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"enum":[["ErrorInfo","Holds the error information"]],"struct":[["ScriptError","Script error struct"]]});
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!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 `ScriptError` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptError"><title>duckscript::types::error::ScriptError - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ScriptError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.info">info</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>error</a></p><script>window.sidebarCurrent = {name: 'ScriptError', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/error.rs.html#63-66' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>error</a>::<wbr><a class="struct" href=''>ScriptError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ScriptError {
|
||||||
|
pub info: <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a>,
|
||||||
|
}</pre></div><div class='docblock'><p>Script error struct</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.info" class="structfield small-section-header"><a href="#structfield.info" class="anchor field"></a><code id="info.v">info: <a class="enum" href="../../../duckscript/types/error/enum.ErrorInfo.html" title="enum duckscript::types::error::ErrorInfo">ErrorInfo</a></code></span><div class='docblock'><p>Holds the error information</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/error.rs.html#68-116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class='srclink' href='../../../src/duckscript/types/error.rs.html#70-115' title='goto source code'>[src]</a></h4><div class='docblock'><p>Formats the script error using the given formatter.</p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/error.rs.html#61' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/error.rs.html#61' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/error/struct.ScriptError.html" title="struct duckscript::types::error::ScriptError">ScriptError</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2132-2142' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2134-2141' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
8
docs/api/duckscript/duckscript/types/index.html
Normal file
8
docs/api/duckscript/duckscript/types/index.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!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 `types` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, types"><title>duckscript::types - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module types</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li></ul></div><p class='location'><a href='../index.html'>duckscript</a></p><script>window.sidebarCurrent = {name: 'types', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/mod.rs.html#1-8' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>duckscript</a>::<wbr><a class="mod" href=''>types</a></span></h1><div class='docblock'><h1 id="types" class="section-header"><a href="#types">types</a></h1>
|
||||||
|
<p>All duckscript types.</p>
|
||||||
|
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="mod" href="command/index.html" title='duckscript::types::command mod'>command</a></td><td class='docblock-short'><p>command</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="mod" href="error/index.html" title='duckscript::types::error mod'>error</a></td><td class='docblock-short'><p>error</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="mod" href="instruction/index.html" title='duckscript::types::instruction mod'>instruction</a></td><td class='docblock-short'><p>instruction</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="mod" href="runtime/index.html" title='duckscript::types::runtime mod'>runtime</a></td><td class='docblock-short'><p>runtime</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!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 `InstructionType` enum in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, InstructionType"><title>duckscript::types::instruction::InstructionType - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum InstructionType</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Empty">Empty</a><a href="#variant.PreProcess">PreProcess</a><a href="#variant.Script">Script</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a></p><script>window.sidebarCurrent = {name: 'InstructionType', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#75-82' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a>::<wbr><a class="enum" href=''>InstructionType</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum InstructionType {
|
||||||
|
Empty,
|
||||||
|
PreProcess(<a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a>),
|
||||||
|
Script(<a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a>),
|
||||||
|
}</pre></div><div class='docblock'><p>Instruction Type - script, preprocess</p>
|
||||||
|
</div><h2 id='variants' class='variants small-section-header'>
|
||||||
|
Variants<a href='#variants' class='anchor'></a></h2>
|
||||||
|
<span id="variant.Empty" class="variant small-section-header"><a href="#variant.Empty" class="anchor field"></a><code id='Empty.v'>Empty</code></span><div class='docblock'><p>Empty instruction</p>
|
||||||
|
</div><span id="variant.PreProcess" class="variant small-section-header"><a href="#variant.PreProcess" class="anchor field"></a><code id='PreProcess.v'>PreProcess(<a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a>)</code></span><div class='docblock'><p>Preprocess instruction</p>
|
||||||
|
</div><span id="variant.Script" class="variant small-section-header"><a href="#variant.Script" class="anchor field"></a><code id='Script.v'>Script(<a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a>)</code></span><div class='docblock'><p>Runtime script instruction</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#74' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#74' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#74' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
10
docs/api/duckscript/duckscript/types/instruction/index.html
Normal file
10
docs/api/duckscript/duckscript/types/instruction/index.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!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 `instruction` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, instruction"><title>duckscript::types::instruction - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module instruction</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a></p><script>window.sidebarCurrent = {name: 'instruction', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#1-121' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a class="mod" href=''>instruction</a></span></h1><div class='docblock'><h1 id="instruction" class="section-header"><a href="#instruction">instruction</a></h1>
|
||||||
|
<p>The instruction type.</p>
|
||||||
|
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="struct" href="struct.Instruction.html" title='duckscript::types::instruction::Instruction struct'>Instruction</a></td><td class='docblock-short'><p>Instruction data</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InstructionMetaInfo.html" title='duckscript::types::instruction::InstructionMetaInfo struct'>InstructionMetaInfo</a></td><td class='docblock-short'><p>Meta information for all instruction types</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.PreProcessInstruction.html" title='duckscript::types::instruction::PreProcessInstruction struct'>PreProcessInstruction</a></td><td class='docblock-short'><p>Preprocess instruction</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ScriptInstruction.html" title='duckscript::types::instruction::ScriptInstruction struct'>ScriptInstruction</a></td><td class='docblock-short'><p>Runtime script instruction</p>
|
||||||
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="enum" href="enum.InstructionType.html" title='duckscript::types::instruction::InstructionType enum'>InstructionType</a></td><td class='docblock-short'><p>Instruction Type - script, preprocess</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"enum":[["InstructionType","Instruction Type - script, preprocess"]],"struct":[["Instruction","Instruction data"],["InstructionMetaInfo","Meta information for all instruction types"],["PreProcessInstruction","Preprocess instruction"],["ScriptInstruction","Runtime script instruction"]]});
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!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 `Instruction` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, Instruction"><title>duckscript::types::instruction::Instruction - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Instruction</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.meta_info">meta_info</a><a href="#structfield.instruction_type">instruction_type</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a></p><script>window.sidebarCurrent = {name: 'Instruction', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#105-110' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a>::<wbr><a class="struct" href=''>Instruction</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Instruction {
|
||||||
|
pub meta_info: <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a>,
|
||||||
|
pub instruction_type: <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a>,
|
||||||
|
}</pre></div><div class='docblock'><p>Instruction data</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.meta_info" class="structfield small-section-header"><a href="#structfield.meta_info" class="anchor field"></a><code id="meta_info.v">meta_info: <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code></span><div class='docblock'><p>Meta info</p>
|
||||||
|
</div><span id="structfield.instruction_type" class="structfield small-section-header"><a href="#structfield.instruction_type" class="anchor field"></a><code id="instruction_type.v">instruction_type: <a class="enum" href="../../../duckscript/types/instruction/enum.InstructionType.html" title="enum duckscript::types::instruction::InstructionType">InstructionType</a></code></span><div class='docblock'><p>The instruction</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#104' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#104' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#104' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#104' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!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 `InstructionMetaInfo` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, InstructionMetaInfo"><title>duckscript::types::instruction::InstructionMetaInfo - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct InstructionMetaInfo</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.line">line</a><a href="#structfield.source">source</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a></p><script>window.sidebarCurrent = {name: 'InstructionMetaInfo', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#86-91' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a>::<wbr><a class="struct" href=''>InstructionMetaInfo</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct InstructionMetaInfo {
|
||||||
|
pub line: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
|
||||||
|
pub source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
}</pre></div><div class='docblock'><p>Meta information for all instruction types</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.line" class="structfield small-section-header"><a href="#structfield.line" class="anchor field"></a><code id="line.v">line: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>The line number</p>
|
||||||
|
</div><span id="structfield.source" class="structfield small-section-header"><a href="#structfield.source" class="anchor field"></a><code id="source.v">source: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The source file/url/...</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#93-101' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#95-100' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#85' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#85' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.InstructionMetaInfo.html" title="struct duckscript::types::instruction::InstructionMetaInfo">InstructionMetaInfo</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!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 `PreProcessInstruction` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, PreProcessInstruction"><title>duckscript::types::instruction::PreProcessInstruction - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct PreProcessInstruction</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.command">command</a><a href="#structfield.arguments">arguments</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a></p><script>window.sidebarCurrent = {name: 'PreProcessInstruction', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#17-22' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a>::<wbr><a class="struct" href=''>PreProcessInstruction</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct PreProcessInstruction {
|
||||||
|
pub command: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
pub arguments: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>,
|
||||||
|
}</pre></div><div class='docblock'><p>Preprocess instruction</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.command" class="structfield small-section-header"><a href="#structfield.command" class="anchor field"></a><code id="command.v">command: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The command name</p>
|
||||||
|
</div><span id="structfield.arguments" class="structfield small-section-header"><a href="#structfield.arguments" class="anchor field"></a><code id="arguments.v">arguments: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></code></span><div class='docblock'><p>The command arguments</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#24-32' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#26-31' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#16' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#16' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#16' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#16' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.PreProcessInstruction.html" title="struct duckscript::types::instruction::PreProcessInstruction">PreProcessInstruction</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<!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 `ScriptInstruction` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, ScriptInstruction"><title>duckscript::types::instruction::ScriptInstruction - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ScriptInstruction</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.label">label</a><a href="#structfield.output">output</a><a href="#structfield.command">command</a><a href="#structfield.arguments">arguments</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a></p><script>window.sidebarCurrent = {name: 'ScriptInstruction', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/instruction.rs.html#43-52' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>instruction</a>::<wbr><a class="struct" href=''>ScriptInstruction</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ScriptInstruction {
|
||||||
|
pub label: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
pub output: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
pub command: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
pub arguments: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>,
|
||||||
|
}</pre></div><div class='docblock'><p>Runtime script instruction</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.label" class="structfield small-section-header"><a href="#structfield.label" class="anchor field"></a><code id="label.v">label: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The label tag</p>
|
||||||
|
</div><span id="structfield.output" class="structfield small-section-header"><a href="#structfield.output" class="anchor field"></a><code id="output.v">output: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The command output variable name</p>
|
||||||
|
</div><span id="structfield.command" class="structfield small-section-header"><a href="#structfield.command" class="anchor field"></a><code id="command.v">command: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The command name</p>
|
||||||
|
</div><span id="structfield.arguments" class="structfield small-section-header"><a href="#structfield.arguments" class="anchor field"></a><code id="arguments.v">arguments: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></code></span><div class='docblock'><p>The command arguments</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#54-64' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#56-63' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#42' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#42' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#42' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/instruction.rs.html#42' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/instruction/struct.ScriptInstruction.html" title="struct duckscript::types::instruction::ScriptInstruction">ScriptInstruction</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<!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 `StateValue` enum in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, StateValue"><title>duckscript::types::runtime::StateValue - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum StateValue</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Boolean">Boolean</a><a href="#variant.Number">Number</a><a href="#variant.UnsignedNumber">UnsignedNumber</a><a href="#variant.String">String</a><a href="#variant.List">List</a><a href="#variant.SubState">SubState</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a></p><script>window.sidebarCurrent = {name: 'StateValue', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/runtime.rs.html#16-29' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a>::<wbr><a class="enum" href=''>StateValue</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum StateValue {
|
||||||
|
Boolean(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>),
|
||||||
|
Number(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a>),
|
||||||
|
UnsignedNumber(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>),
|
||||||
|
String(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
||||||
|
List(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>),
|
||||||
|
SubState(<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>),
|
||||||
|
}</pre></div><div class='docblock'><p>enum defining what values can be stored in the state map</p>
|
||||||
|
</div><h2 id='variants' class='variants small-section-header'>
|
||||||
|
Variants<a href='#variants' class='anchor'></a></h2>
|
||||||
|
<span id="variant.Boolean" class="variant small-section-header"><a href="#variant.Boolean" class="anchor field"></a><code id='Boolean.v'>Boolean(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span><div class='docblock'><p>boolean value</p>
|
||||||
|
</div><span id="variant.Number" class="variant small-section-header"><a href="#variant.Number" class="anchor field"></a><code id='Number.v'>Number(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a>)</code></span><div class='docblock'><p>signed number</p>
|
||||||
|
</div><span id="variant.UnsignedNumber" class="variant small-section-header"><a href="#variant.UnsignedNumber" class="anchor field"></a><code id='UnsignedNumber.v'>UnsignedNumber(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></span><div class='docblock'><p>unsigned number</p>
|
||||||
|
</div><span id="variant.String" class="variant small-section-header"><a href="#variant.String" class="anchor field"></a><code id='String.v'>String(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span><div class='docblock'><p>textual value</p>
|
||||||
|
</div><span id="variant.List" class="variant small-section-header"><a href="#variant.List" class="anchor field"></a><code id='List.v'>List(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>)</code></span><div class='docblock'><p>list</p>
|
||||||
|
</div><span id="variant.SubState" class="variant small-section-header"><a href="#variant.SubState" class="anchor field"></a><code id='SubState.v'>SubState(<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>)</code></span><div class='docblock'><p>sub state value</p>
|
||||||
|
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#15' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#15' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#15' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#15' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||||
|
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||||
|
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||||
|
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||||||
|
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
8
docs/api/duckscript/duckscript/types/runtime/index.html
Normal file
8
docs/api/duckscript/duckscript/types/runtime/index.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!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 `runtime` mod in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, runtime"><title>duckscript::types::runtime - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module runtime</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a></p><script>window.sidebarCurrent = {name: 'runtime', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/runtime.rs.html#1-71' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a class="mod" href=''>runtime</a></span></h1><div class='docblock'><h1 id="runtime" class="section-header"><a href="#runtime">runtime</a></h1>
|
||||||
|
<p>The runtime context structures.</p>
|
||||||
|
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="struct" href="struct.Context.html" title='duckscript::types::runtime::Context struct'>Context</a></td><td class='docblock-short'><p>The context structure</p>
|
||||||
|
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Runtime.html" title='duckscript::types::runtime::Runtime struct'>Runtime</a></td><td class='docblock-short'><p>The runtime structure</p>
|
||||||
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||||
|
<table><tr class='module-item'><td><a class="enum" href="enum.StateValue.html" title='duckscript::types::runtime::StateValue enum'>StateValue</a></td><td class='docblock-short'><p>enum defining what values can be stored in the state map</p>
|
||||||
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"enum":[["StateValue","enum defining what values can be stored in the state map"]],"struct":[["Context","The context structure"],["Runtime","The runtime structure"]]});
|
|
@ -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="API documentation for the Rust `Context` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, Context"><title>duckscript::types::runtime::Context - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Context</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.variables">variables</a><a href="#structfield.state">state</a><a href="#structfield.commands">commands</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a></p><script>window.sidebarCurrent = {name: 'Context', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/runtime.rs.html#32-39' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a>::<wbr><a class="struct" href=''>Context</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Context {
|
||||||
|
pub variables: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,
|
||||||
|
pub state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>>,
|
||||||
|
pub commands: <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a>,
|
||||||
|
}</pre></div><div class='docblock'><p>The context structure</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.variables" class="structfield small-section-header"><a href="#structfield.variables" class="anchor field"></a><code id="variables.v">variables: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><div class='docblock'><p>The runtime variables</p>
|
||||||
|
</div><span id="structfield.state" class="structfield small-section-header"><a href="#structfield.state" class="anchor field"></a><code id="state.v">state: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../../../duckscript/types/runtime/enum.StateValue.html" title="enum duckscript::types::runtime::StateValue">StateValue</a>></code></span><div class='docblock'><p>The runtime state</p>
|
||||||
|
</div><span id="structfield.commands" class="structfield small-section-header"><a href="#structfield.commands" class="anchor field"></a><code id="commands.v">commands: <a class="struct" href="../../../duckscript/types/command/struct.Commands.html" title="struct duckscript::types::command::Commands">Commands</a></code></span><div class='docblock'><p>The command implementations</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#41-50' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#43-49' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -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="API documentation for the Rust `Runtime` struct in crate `duckscript`."><meta name="keywords" content="rust, rustlang, rust-lang, Runtime"><title>duckscript::types::runtime::Runtime - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Runtime</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.instructions">instructions</a><a href="#structfield.label_to_line">label_to_line</a><a href="#structfield.context">context</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><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><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><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><p class='location'><a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a></p><script>window.sidebarCurrent = {name: 'Runtime', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/duckscript/types/runtime.rs.html#53-60' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../index.html'>duckscript</a>::<wbr><a href='../index.html'>types</a>::<wbr><a href='index.html'>runtime</a>::<wbr><a class="struct" href=''>Runtime</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Runtime {
|
||||||
|
pub instructions: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>>,
|
||||||
|
pub label_to_line: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>,
|
||||||
|
pub context: <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a>,
|
||||||
|
}</pre></div><div class='docblock'><p>The runtime structure</p>
|
||||||
|
</div><h2 id='fields' class='fields small-section-header'>
|
||||||
|
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.instructions" class="structfield small-section-header"><a href="#structfield.instructions" class="anchor field"></a><code id="instructions.v">instructions: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../duckscript/types/instruction/struct.Instruction.html" title="struct duckscript::types::instruction::Instruction">Instruction</a>>></code></span><div class='docblock'><p>The script instructions</p>
|
||||||
|
</div><span id="structfield.label_to_line" class="structfield small-section-header"><a href="#structfield.label_to_line" class="anchor field"></a><code id="label_to_line.v">label_to_line: <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></code></span><div class='docblock'><p>Label to line number mapping</p>
|
||||||
|
</div><span id="structfield.context" class="structfield small-section-header"><a href="#structfield.context" class="anchor field"></a><code id="context.v">context: <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a></code></span><div class='docblock'><p>The runtime context</p>
|
||||||
|
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#62-71' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(context: <a class="struct" href="../../../duckscript/types/runtime/struct.Context.html" title="struct duckscript::types::runtime::Context">Context</a>) -> <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a class='srclink' href='../../../src/duckscript/types/runtime.rs.html#64-70' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates and returns a new instance.</p>
|
||||||
|
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../duckscript/types/runtime/struct.Runtime.html" title="struct duckscript::types::runtime::Runtime">Runtime</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></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'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#549-551' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#540-545' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#542-544' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#568-574' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-573' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#556-563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||||
|
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#560-562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||||
|
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||||
|
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/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/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||||
|
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
1
docs/api/duckscript/duckscript/types/sidebar-items.js
Normal file
1
docs/api/duckscript/duckscript/types/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
initSidebarItems({"mod":[["command","command"],["error","error"],["instruction","instruction"],["runtime","runtime"]]});
|
BIN
docs/api/duckscript/favicon.ico
Normal file
BIN
docs/api/duckscript/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
10
docs/api/duckscript/implementors/core/clone/trait.Clone.js
Normal file
10
docs/api/duckscript/implementors/core/clone/trait.Clone.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:false,types:["duckscript::types::command::GoToValue"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:false,types:["duckscript::types::command::CommandResult"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:false,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:false,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:false,types:["duckscript::types::instruction::InstructionType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:false,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:false,types:["duckscript::types::instruction::Instruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:false,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/fmt/trait.Debug.js
Normal file
10
docs/api/duckscript/implementors/core/fmt/trait.Debug.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:false,types:["duckscript::types::command::GoToValue"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:false,types:["duckscript::types::command::CommandResult"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"duckscript/types/error/enum.ErrorInfo.html\" title=\"enum duckscript::types::error::ErrorInfo\">ErrorInfo</a>",synthetic:false,types:["duckscript::types::error::ErrorInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:false,types:["duckscript::types::error::ScriptError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:false,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:false,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:false,types:["duckscript::types::instruction::InstructionType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:false,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:false,types:["duckscript::types::instruction::Instruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:false,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/fmt/trait.Display.js
Normal file
10
docs/api/duckscript/implementors/core/fmt/trait.Display.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:false,types:["duckscript::types::error::ScriptError"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/marker/trait.Freeze.js
Normal file
10
docs/api/duckscript/implementors/core/marker/trait.Freeze.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/command/struct.Commands.html\" title=\"struct duckscript::types::command::Commands\">Commands</a>",synthetic:true,types:["duckscript::types::command::Commands"]},{text:"impl Freeze for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:true,types:["duckscript::types::command::GoToValue"]},{text:"impl Freeze for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:true,types:["duckscript::types::command::CommandResult"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:true,types:["duckscript::types::error::ScriptError"]},{text:"impl Freeze for <a class=\"enum\" href=\"duckscript/types/error/enum.ErrorInfo.html\" title=\"enum duckscript::types::error::ErrorInfo\">ErrorInfo</a>",synthetic:true,types:["duckscript::types::error::ErrorInfo"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:true,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:true,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:true,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:true,types:["duckscript::types::instruction::Instruction"]},{text:"impl Freeze for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:true,types:["duckscript::types::instruction::InstructionType"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Context.html\" title=\"struct duckscript::types::runtime::Context\">Context</a>",synthetic:true,types:["duckscript::types::runtime::Context"]},{text:"impl Freeze for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Runtime.html\" title=\"struct duckscript::types::runtime::Runtime\">Runtime</a>",synthetic:true,types:["duckscript::types::runtime::Runtime"]},{text:"impl Freeze for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:true,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/marker/trait.Send.js
Normal file
10
docs/api/duckscript/implementors/core/marker/trait.Send.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/command/struct.Commands.html\" title=\"struct duckscript::types::command::Commands\">Commands</a>",synthetic:true,types:["duckscript::types::command::Commands"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:true,types:["duckscript::types::command::GoToValue"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:true,types:["duckscript::types::command::CommandResult"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:true,types:["duckscript::types::error::ScriptError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"duckscript/types/error/enum.ErrorInfo.html\" title=\"enum duckscript::types::error::ErrorInfo\">ErrorInfo</a>",synthetic:true,types:["duckscript::types::error::ErrorInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:true,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:true,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:true,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:true,types:["duckscript::types::instruction::Instruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:true,types:["duckscript::types::instruction::InstructionType"]},{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Context.html\" title=\"struct duckscript::types::runtime::Context\">Context</a>",synthetic:true,types:["duckscript::types::runtime::Context"]},{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Runtime.html\" title=\"struct duckscript::types::runtime::Runtime\">Runtime</a>",synthetic:true,types:["duckscript::types::runtime::Runtime"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:true,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/marker/trait.Sync.js
Normal file
10
docs/api/duckscript/implementors/core/marker/trait.Sync.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/command/struct.Commands.html\" title=\"struct duckscript::types::command::Commands\">Commands</a>",synthetic:true,types:["duckscript::types::command::Commands"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:true,types:["duckscript::types::command::GoToValue"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:true,types:["duckscript::types::command::CommandResult"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:true,types:["duckscript::types::error::ScriptError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"duckscript/types/error/enum.ErrorInfo.html\" title=\"enum duckscript::types::error::ErrorInfo\">ErrorInfo</a>",synthetic:true,types:["duckscript::types::error::ErrorInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:true,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:true,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:true,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:true,types:["duckscript::types::instruction::Instruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:true,types:["duckscript::types::instruction::InstructionType"]},{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Context.html\" title=\"struct duckscript::types::runtime::Context\">Context</a>",synthetic:true,types:["duckscript::types::runtime::Context"]},{text:"impl !<a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Runtime.html\" title=\"struct duckscript::types::runtime::Runtime\">Runtime</a>",synthetic:true,types:["duckscript::types::runtime::Runtime"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:true,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
10
docs/api/duckscript/implementors/core/marker/trait.Unpin.js
Normal file
10
docs/api/duckscript/implementors/core/marker/trait.Unpin.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(function() {var implementors = {};
|
||||||
|
implementors["duckscript"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/command/struct.Commands.html\" title=\"struct duckscript::types::command::Commands\">Commands</a>",synthetic:true,types:["duckscript::types::command::Commands"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.GoToValue.html\" title=\"enum duckscript::types::command::GoToValue\">GoToValue</a>",synthetic:true,types:["duckscript::types::command::GoToValue"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"duckscript/types/command/enum.CommandResult.html\" title=\"enum duckscript::types::command::CommandResult\">CommandResult</a>",synthetic:true,types:["duckscript::types::command::CommandResult"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/error/struct.ScriptError.html\" title=\"struct duckscript::types::error::ScriptError\">ScriptError</a>",synthetic:true,types:["duckscript::types::error::ScriptError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"duckscript/types/error/enum.ErrorInfo.html\" title=\"enum duckscript::types::error::ErrorInfo\">ErrorInfo</a>",synthetic:true,types:["duckscript::types::error::ErrorInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.PreProcessInstruction.html\" title=\"struct duckscript::types::instruction::PreProcessInstruction\">PreProcessInstruction</a>",synthetic:true,types:["duckscript::types::instruction::PreProcessInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.ScriptInstruction.html\" title=\"struct duckscript::types::instruction::ScriptInstruction\">ScriptInstruction</a>",synthetic:true,types:["duckscript::types::instruction::ScriptInstruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.InstructionMetaInfo.html\" title=\"struct duckscript::types::instruction::InstructionMetaInfo\">InstructionMetaInfo</a>",synthetic:true,types:["duckscript::types::instruction::InstructionMetaInfo"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/instruction/struct.Instruction.html\" title=\"struct duckscript::types::instruction::Instruction\">Instruction</a>",synthetic:true,types:["duckscript::types::instruction::Instruction"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"duckscript/types/instruction/enum.InstructionType.html\" title=\"enum duckscript::types::instruction::InstructionType\">InstructionType</a>",synthetic:true,types:["duckscript::types::instruction::InstructionType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Context.html\" title=\"struct duckscript::types::runtime::Context\">Context</a>",synthetic:true,types:["duckscript::types::runtime::Context"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"struct\" href=\"duckscript/types/runtime/struct.Runtime.html\" title=\"struct duckscript::types::runtime::Runtime\">Runtime</a>",synthetic:true,types:["duckscript::types::runtime::Runtime"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> for <a class=\"enum\" href=\"duckscript/types/runtime/enum.StateValue.html\" title=\"enum duckscript::types::runtime::StateValue\">StateValue</a>",synthetic:true,types:["duckscript::types::runtime::StateValue"]},];
|
||||||
|
|
||||||
|
if (window.register_implementors) {
|
||||||
|
window.register_implementors(implementors);
|
||||||
|
} else {
|
||||||
|
window.pending_implementors = implementors;
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
docs/api/duckscript/light.css
Normal file
1
docs/api/duckscript/light.css
Normal file
File diff suppressed because one or more lines are too long
95
docs/api/duckscript/main.js
Normal file
95
docs/api/duckscript/main.js
Normal file
File diff suppressed because one or more lines are too long
2
docs/api/duckscript/normalize.css
vendored
Normal file
2
docs/api/duckscript/normalize.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
|
||||||
|
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
|
1
docs/api/duckscript/noscript.css
Normal file
1
docs/api/duckscript/noscript.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}
|
BIN
docs/api/duckscript/rust-logo.png
Normal file
BIN
docs/api/duckscript/rust-logo.png
Normal file
Binary file not shown.
1
docs/api/duckscript/rustdoc.css
Normal file
1
docs/api/duckscript/rustdoc.css
Normal file
File diff suppressed because one or more lines are too long
5
docs/api/duckscript/search-index.js
Normal file
5
docs/api/duckscript/search-index.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/api/duckscript/settings.css
Normal file
1
docs/api/duckscript/settings.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.setting-line{padding:5px;}.setting-line>div{max-width:calc(100% - 74px);display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{display:none;}.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 1px #2196F3;}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}
|
1
docs/api/duckscript/settings.html
Normal file
1
docs/api/duckscript/settings.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<!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="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="./settings.css"><link rel="stylesheet" type="text/css" href="./dark.css"><link rel="stylesheet" type="text/css" href="./light.css" id="themeStyle"><script src="./storage.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="shortcut icon" href="./favicon.ico"><style type="text/css">#crate-search{background-image:url("./down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='./duckscript/index.html'><div class='logo-container'><img src='./rust-logo.png' alt='logo'></div></a><p class='location'>Settings</p><div class='sidebar-elems'></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="./brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="./theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="./settings.html"><img src="./wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Rustdoc settings</span></h1><div class='settings'><div class='setting-line'><label class='toggle'><input type='checkbox' id='item-declarations' checked><span class='slider'></span></label><div>Auto-hide item declarations.</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='item-attributes' checked><span class='slider'></span></label><div>Auto-hide item attributes.</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='trait-implementations' checked><span class='slider'></span></label><div>Auto-hide trait implementations documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='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='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><script src='./settings.js'></script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "./";window.currentCrate = "duckscript";</script><script src="./aliases.js"></script><script src="./main.js"></script><script defer src="./search-index.js"></script></body></html>
|
1
docs/api/duckscript/settings.js
Normal file
1
docs/api/duckscript/settings.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled);}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName);}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return;}for(var i=0;i<elems.length;++i){var toggle=elems[i].previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true";}toggle.onchange=function(){changeSetting(this.id,this.checked);};}}setEvents();})();
|
3
docs/api/duckscript/source-files.js
Normal file
3
docs/api/duckscript/source-files.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
var N = null;var sourcesIndex = {};
|
||||||
|
sourcesIndex["duckscript"] = {"name":"","dirs":[{"name":"preprocessor","files":["include_files_preprocessor.rs","mod.rs","print_preprocessor.rs"]},{"name":"types","files":["command.rs","error.rs","instruction.rs","mod.rs","runtime.rs"]}],"files":["expansion.rs","io.rs","lib.rs","parser.rs","runner.rs"]};
|
||||||
|
createSourceSidebar();
|
1
docs/api/duckscript/source-script.js
Normal file
1
docs/api/duckscript/source-script.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0;i<rootPathParts.length;++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 children=document.createElement("div");children.className="children";var folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(var i=0;i<elem.dirs.length;++i){if(createDirEntry(elem.dirs[i],folders,fullPath,currentFile,hasFoundFile)===true){addClass(name,"expand");hasFoundFile=true;}}}children.appendChild(folders);var files=document.createElement("div");files.className="files";if(elem.files){for(i=0;i<elem.files.length;++i){var file=document.createElement("a");file.innerText=elem.files[i];file.href=window.rootPath+"src/"+fullPath+elem.files[i]+".html";if(hasFoundFile===false&¤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===true&¤tFile.startsWith(fullPath);}function toggleSidebar(){var sidebar=document.getElementById("source-sidebar");var child=this.children[0].children[0];if(child.innerText===">"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true");}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false");}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<";}else{inner2.innerText=">";sidebarToggle.style.left="0";}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle;}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/";}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px";}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);});main.insertBefore(sidebar,main.firstChild);}
|
149
docs/api/duckscript/src/duckscript/expansion.rs.html
Normal file
149
docs/api/duckscript/src/duckscript/expansion.rs.html
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/expansion.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>expansion.rs.html -- source</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # expansion</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The expand utility functions.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./expansion_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">expansion_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">should_break_key</span>(<span class="ident">value</span>: <span class="ident">char</span>) <span class="op">-></span> <span class="ident">bool</span> {
|
||||||
|
<span class="ident">value</span> <span class="op">==</span> <span class="string">' '</span> <span class="op">||</span> <span class="ident">value</span> <span class="op">==</span> <span class="string">'\n'</span> <span class="op">||</span> <span class="ident">value</span> <span class="op">==</span> <span class="string">'\t'</span> <span class="op">||</span> <span class="ident">value</span> <span class="op">==</span> <span class="string">'\r'</span> <span class="op">||</span> <span class="ident">value</span> <span class="op">==</span> <span class="string">'='</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">expand_by_wrapper</span>(
|
||||||
|
<span class="ident">value</span>: <span class="kw-2">&</span><span class="ident">str</span>,
|
||||||
|
<span class="ident">prefix</span>: <span class="kw-2">&</span><span class="ident">str</span>,
|
||||||
|
<span class="ident">suffix</span>: <span class="ident">char</span>,
|
||||||
|
<span class="ident">variables</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span>,
|
||||||
|
) <span class="op">-></span> <span class="ident">String</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value_string</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">prefix_length</span> <span class="op">=</span> <span class="ident">prefix</span>.<span class="ident">len</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">prefix_index</span> <span class="op">=</span> <span class="number">0</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">prefix_chars</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span> <span class="op">=</span> <span class="ident">prefix</span>.<span class="ident">chars</span>().<span class="ident">collect</span>();
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">found_prefix</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">next_char</span> <span class="kw">in</span> <span class="ident">value</span>.<span class="ident">chars</span>() {
|
||||||
|
<span class="kw">if</span> <span class="op">!</span><span class="ident">found_prefix</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">next_char</span> <span class="op">==</span> <span class="ident">prefix_chars</span>[<span class="ident">prefix_index</span>] {
|
||||||
|
<span class="ident">prefix_index</span> <span class="op">=</span> <span class="ident">prefix_index</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">prefix_index</span> <span class="op">==</span> <span class="ident">prefix_length</span> {
|
||||||
|
<span class="ident">found_prefix</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
<span class="ident">prefix_index</span> <span class="op">=</span> <span class="number">0</span>;
|
||||||
|
<span class="ident">key</span>.<span class="ident">clear</span>();
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">prefix_index</span> <span class="op">></span> <span class="number">0</span> {
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">prefix</span>[..<span class="ident">prefix_index</span>]);
|
||||||
|
<span class="ident">prefix_index</span> <span class="op">=</span> <span class="number">0</span>;
|
||||||
|
}
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push</span>(<span class="ident">next_char</span>);
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">next_char</span> <span class="op">==</span> <span class="ident">suffix</span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">variables</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">key</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">variable_value</span>) <span class="op">=></span> <span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">variable_value</span>),
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> (),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="ident">key</span>.<span class="ident">clear</span>();
|
||||||
|
<span class="ident">found_prefix</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">should_break_key</span>(<span class="ident">next_char</span>) {
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">key</span>);
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push</span>(<span class="ident">next_char</span>);
|
||||||
|
|
||||||
|
<span class="ident">key</span>.<span class="ident">clear</span>();
|
||||||
|
<span class="ident">found_prefix</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">key</span>.<span class="ident">push</span>(<span class="ident">next_char</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">key</span>.<span class="ident">len</span>() <span class="op">></span> <span class="number">0</span> {
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">prefix</span>);
|
||||||
|
<span class="ident">value_string</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">key</span>);
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="ident">value_string</span>
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
61
docs/api/duckscript/src/duckscript/io.rs.html
Normal file
61
docs/api/duckscript/src/duckscript/io.rs.html
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/io.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>io.rs.html -- source</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # io</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! IO helper functions</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./io_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">io_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::{<span class="ident">ErrorInfo</span>, <span class="ident">ScriptError</span>};
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Read</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
|
||||||
|
|
||||||
|
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">read_text_file</span>(<span class="ident">file</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">file_path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="ident">file</span>);
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="kw-2">&</span><span class="ident">file_path</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="kw-2">mut</span> <span class="ident">fd</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">content</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
<span class="ident">fd</span>.<span class="ident">read_to_string</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">content</span>).<span class="ident">unwrap</span>();
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">content</span>)
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">ErrorReadingFile</span>(<span class="ident">file</span>.<span class="ident">to_string</span>(), <span class="prelude-val">Some</span>(<span class="ident">error</span>)),
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
269
docs/api/duckscript/src/duckscript/lib.rs.html
Normal file
269
docs/api/duckscript/src/duckscript/lib.rs.html
Normal file
|
@ -0,0 +1,269 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/lib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>lib.rs.html -- source</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="attribute">#![<span class="ident">deny</span>(
|
||||||
|
<span class="ident">absolute_paths_not_starting_with_crate</span>,
|
||||||
|
<span class="ident">ambiguous_associated_items</span>,
|
||||||
|
<span class="ident">anonymous_parameters</span>,
|
||||||
|
<span class="ident">const_err</span>,
|
||||||
|
<span class="ident">dead_code</span>,
|
||||||
|
<span class="ident">deprecated</span>,
|
||||||
|
<span class="ident">deprecated_in_future</span>,
|
||||||
|
<span class="ident">duplicate_macro_exports</span>,
|
||||||
|
<span class="ident">ellipsis_inclusive_range_patterns</span>,
|
||||||
|
<span class="ident">exceeding_bitshifts</span>,
|
||||||
|
<span class="ident">explicit_outlives_requirements</span>,
|
||||||
|
<span class="ident">exported_private_dependencies</span>,
|
||||||
|
<span class="ident">ill_formed_attribute_input</span>,
|
||||||
|
<span class="ident">illegal_floating_point_literal_pattern</span>,
|
||||||
|
<span class="ident">improper_ctypes</span>,
|
||||||
|
<span class="ident">indirect_structural_match</span>,
|
||||||
|
<span class="ident">invalid_type_param_default</span>,
|
||||||
|
<span class="ident">irrefutable_let_patterns</span>,
|
||||||
|
<span class="ident">keyword_idents</span>,
|
||||||
|
<span class="ident">late_bound_lifetime_arguments</span>,
|
||||||
|
<span class="ident">legacy_constructor_visibility</span>,
|
||||||
|
<span class="ident">legacy_directory_ownership</span>,
|
||||||
|
<span class="ident">macro_expanded_macro_exports_accessed_by_absolute_paths</span>,
|
||||||
|
<span class="ident">missing_copy_implementations</span>,
|
||||||
|
<span class="ident">missing_docs</span>,
|
||||||
|
<span class="ident">missing_fragment_specifier</span>,
|
||||||
|
<span class="ident">mutable_borrow_reservation_conflict</span>,
|
||||||
|
<span class="ident">mutable_transmutes</span>,
|
||||||
|
<span class="ident">nested_impl_trait</span>,
|
||||||
|
<span class="ident">no_mangle_const_items</span>,
|
||||||
|
<span class="ident">no_mangle_generic_items</span>,
|
||||||
|
<span class="ident">non_ascii_idents</span>,
|
||||||
|
<span class="ident">non_camel_case_types</span>,
|
||||||
|
<span class="ident">non_shorthand_field_patterns</span>,
|
||||||
|
<span class="ident">non_snake_case</span>,
|
||||||
|
<span class="ident">non_upper_case_globals</span>,
|
||||||
|
<span class="ident">order_dependent_trait_objects</span>,
|
||||||
|
<span class="ident">overflowing_literals</span>,
|
||||||
|
<span class="ident">parenthesized_params_in_types_and_modules</span>,
|
||||||
|
<span class="ident">path_statements</span>,
|
||||||
|
<span class="ident">patterns_in_fns_without_body</span>,
|
||||||
|
<span class="ident">plugin_as_library</span>,
|
||||||
|
<span class="ident">private_doc_tests</span>,
|
||||||
|
<span class="ident">private_in_public</span>,
|
||||||
|
<span class="ident">proc_macro_derive_resolution_fallback</span>,
|
||||||
|
<span class="ident">pub_use_of_private_extern_crate</span>,
|
||||||
|
<span class="ident">safe_extern_statics</span>,
|
||||||
|
<span class="ident">safe_packed_borrows</span>,
|
||||||
|
<span class="ident">stable_features</span>,
|
||||||
|
<span class="ident">trivial_bounds</span>,
|
||||||
|
<span class="ident">trivial_casts</span>,
|
||||||
|
<span class="ident">trivial_numeric_casts</span>,
|
||||||
|
<span class="ident">type_alias_bounds</span>,
|
||||||
|
<span class="ident">tyvar_behind_raw_pointer</span>,
|
||||||
|
<span class="ident">unconditional_recursion</span>,
|
||||||
|
<span class="ident">unions_with_drop_fields</span>,
|
||||||
|
<span class="ident">unknown_crate_types</span>,
|
||||||
|
<span class="ident">unnameable_test_items</span>,
|
||||||
|
<span class="ident">unreachable_code</span>,
|
||||||
|
<span class="ident">unreachable_patterns</span>,
|
||||||
|
<span class="ident">unreachable_pub</span>,
|
||||||
|
<span class="ident">unsafe_code</span>,
|
||||||
|
<span class="ident">unstable_features</span>,
|
||||||
|
<span class="ident">unstable_name_collisions</span>,
|
||||||
|
<span class="ident">unused_allocation</span>,
|
||||||
|
<span class="ident">unused_assignments</span>,
|
||||||
|
<span class="ident">unused_attributes</span>,
|
||||||
|
<span class="ident">unused_comparisons</span>,
|
||||||
|
<span class="ident">unused_doc_comments</span>,
|
||||||
|
<span class="ident">unused_extern_crates</span>,
|
||||||
|
<span class="ident">unused_features</span>,
|
||||||
|
<span class="ident">unused_import_braces</span>,
|
||||||
|
<span class="ident">unused_imports</span>,
|
||||||
|
<span class="ident">unused_labels</span>,
|
||||||
|
<span class="ident">unused_lifetimes</span>,
|
||||||
|
<span class="ident">unused_macros</span>,
|
||||||
|
<span class="ident">unused_must_use</span>,
|
||||||
|
<span class="ident">unused_mut</span>,
|
||||||
|
<span class="ident">unused_parens</span>,
|
||||||
|
<span class="ident">unused_qualifications</span>,
|
||||||
|
<span class="ident">unused_unsafe</span>,
|
||||||
|
<span class="ident">unused_variables</span>,
|
||||||
|
<span class="ident">where_clauses_object_safety</span>,
|
||||||
|
<span class="ident">while_true</span>
|
||||||
|
)]</span>
|
||||||
|
<span class="attribute">#![<span class="ident">warn</span>(<span class="ident">macro_use_extern_crate</span>, <span class="ident">unknown_lints</span>)]</span>
|
||||||
|
<span class="attribute">#![<span class="ident">allow</span>(
|
||||||
|
<span class="ident">bare_trait_objects</span>,
|
||||||
|
<span class="ident">box_pointers</span>,
|
||||||
|
<span class="ident">elided_lifetimes_in_paths</span>,
|
||||||
|
<span class="ident">intra_doc_link_resolution_failure</span>,
|
||||||
|
<span class="ident">missing_doc_code_examples</span>,
|
||||||
|
<span class="ident">missing_debug_implementations</span>,
|
||||||
|
<span class="ident">single_use_lifetimes</span>,
|
||||||
|
<span class="ident">unused_results</span>,
|
||||||
|
<span class="ident">variant_size_differences</span>,
|
||||||
|
<span class="ident">warnings</span>,
|
||||||
|
<span class="ident">renamed_and_removed_lints</span>
|
||||||
|
)]</span>
|
||||||
|
|
||||||
|
<span class="doccomment">//! # duckscript</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! Simple, extendable and embeddable scripting language.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! This library is the actual script parser and runner.<br></span>
|
||||||
|
<span class="doccomment">//! On it's own, it has no actual commands as those need to be provided externally (see duckscript_sdk).</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! # Installation</span>
|
||||||
|
<span class="doccomment">//! In order to use this library, just add it as a dependency:</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! ```ini</span>
|
||||||
|
<span class="doccomment">//! [dependencies]</span>
|
||||||
|
<span class="doccomment">//! duckscript = "*"</span>
|
||||||
|
<span class="doccomment">//! ```</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! # Contributing</span>
|
||||||
|
<span class="doccomment">//! See [contributing guide](https://github.com/sagiegurari/duckscript/blob/master/.github/CONTRIBUTING.md)</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! # License</span>
|
||||||
|
<span class="doccomment">//! Developed by Sagie Gur-Ari and licensed under the</span>
|
||||||
|
<span class="doccomment">//! [Apache 2](https://github.com/sagiegurari/duckscript/blob/master/LICENSE) open source license.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="kw">mod</span> <span class="ident">expansion</span>;
|
||||||
|
<span class="kw">mod</span> <span class="ident">io</span>;
|
||||||
|
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">parser</span>;
|
||||||
|
<span class="kw">mod</span> <span class="ident">preprocessor</span>;
|
||||||
|
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">runner</span>;
|
||||||
|
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">types</span>;
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">test</span>;
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
891
docs/api/duckscript/src/duckscript/parser.rs.html
Normal file
891
docs/api/duckscript/src/duckscript/parser.rs.html
Normal file
|
@ -0,0 +1,891 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/parser.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>parser.rs.html -- source</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
<span id="306">306</span>
|
||||||
|
<span id="307">307</span>
|
||||||
|
<span id="308">308</span>
|
||||||
|
<span id="309">309</span>
|
||||||
|
<span id="310">310</span>
|
||||||
|
<span id="311">311</span>
|
||||||
|
<span id="312">312</span>
|
||||||
|
<span id="313">313</span>
|
||||||
|
<span id="314">314</span>
|
||||||
|
<span id="315">315</span>
|
||||||
|
<span id="316">316</span>
|
||||||
|
<span id="317">317</span>
|
||||||
|
<span id="318">318</span>
|
||||||
|
<span id="319">319</span>
|
||||||
|
<span id="320">320</span>
|
||||||
|
<span id="321">321</span>
|
||||||
|
<span id="322">322</span>
|
||||||
|
<span id="323">323</span>
|
||||||
|
<span id="324">324</span>
|
||||||
|
<span id="325">325</span>
|
||||||
|
<span id="326">326</span>
|
||||||
|
<span id="327">327</span>
|
||||||
|
<span id="328">328</span>
|
||||||
|
<span id="329">329</span>
|
||||||
|
<span id="330">330</span>
|
||||||
|
<span id="331">331</span>
|
||||||
|
<span id="332">332</span>
|
||||||
|
<span id="333">333</span>
|
||||||
|
<span id="334">334</span>
|
||||||
|
<span id="335">335</span>
|
||||||
|
<span id="336">336</span>
|
||||||
|
<span id="337">337</span>
|
||||||
|
<span id="338">338</span>
|
||||||
|
<span id="339">339</span>
|
||||||
|
<span id="340">340</span>
|
||||||
|
<span id="341">341</span>
|
||||||
|
<span id="342">342</span>
|
||||||
|
<span id="343">343</span>
|
||||||
|
<span id="344">344</span>
|
||||||
|
<span id="345">345</span>
|
||||||
|
<span id="346">346</span>
|
||||||
|
<span id="347">347</span>
|
||||||
|
<span id="348">348</span>
|
||||||
|
<span id="349">349</span>
|
||||||
|
<span id="350">350</span>
|
||||||
|
<span id="351">351</span>
|
||||||
|
<span id="352">352</span>
|
||||||
|
<span id="353">353</span>
|
||||||
|
<span id="354">354</span>
|
||||||
|
<span id="355">355</span>
|
||||||
|
<span id="356">356</span>
|
||||||
|
<span id="357">357</span>
|
||||||
|
<span id="358">358</span>
|
||||||
|
<span id="359">359</span>
|
||||||
|
<span id="360">360</span>
|
||||||
|
<span id="361">361</span>
|
||||||
|
<span id="362">362</span>
|
||||||
|
<span id="363">363</span>
|
||||||
|
<span id="364">364</span>
|
||||||
|
<span id="365">365</span>
|
||||||
|
<span id="366">366</span>
|
||||||
|
<span id="367">367</span>
|
||||||
|
<span id="368">368</span>
|
||||||
|
<span id="369">369</span>
|
||||||
|
<span id="370">370</span>
|
||||||
|
<span id="371">371</span>
|
||||||
|
<span id="372">372</span>
|
||||||
|
<span id="373">373</span>
|
||||||
|
<span id="374">374</span>
|
||||||
|
<span id="375">375</span>
|
||||||
|
<span id="376">376</span>
|
||||||
|
<span id="377">377</span>
|
||||||
|
<span id="378">378</span>
|
||||||
|
<span id="379">379</span>
|
||||||
|
<span id="380">380</span>
|
||||||
|
<span id="381">381</span>
|
||||||
|
<span id="382">382</span>
|
||||||
|
<span id="383">383</span>
|
||||||
|
<span id="384">384</span>
|
||||||
|
<span id="385">385</span>
|
||||||
|
<span id="386">386</span>
|
||||||
|
<span id="387">387</span>
|
||||||
|
<span id="388">388</span>
|
||||||
|
<span id="389">389</span>
|
||||||
|
<span id="390">390</span>
|
||||||
|
<span id="391">391</span>
|
||||||
|
<span id="392">392</span>
|
||||||
|
<span id="393">393</span>
|
||||||
|
<span id="394">394</span>
|
||||||
|
<span id="395">395</span>
|
||||||
|
<span id="396">396</span>
|
||||||
|
<span id="397">397</span>
|
||||||
|
<span id="398">398</span>
|
||||||
|
<span id="399">399</span>
|
||||||
|
<span id="400">400</span>
|
||||||
|
<span id="401">401</span>
|
||||||
|
<span id="402">402</span>
|
||||||
|
<span id="403">403</span>
|
||||||
|
<span id="404">404</span>
|
||||||
|
<span id="405">405</span>
|
||||||
|
<span id="406">406</span>
|
||||||
|
<span id="407">407</span>
|
||||||
|
<span id="408">408</span>
|
||||||
|
<span id="409">409</span>
|
||||||
|
<span id="410">410</span>
|
||||||
|
<span id="411">411</span>
|
||||||
|
<span id="412">412</span>
|
||||||
|
<span id="413">413</span>
|
||||||
|
<span id="414">414</span>
|
||||||
|
<span id="415">415</span>
|
||||||
|
<span id="416">416</span>
|
||||||
|
<span id="417">417</span>
|
||||||
|
<span id="418">418</span>
|
||||||
|
<span id="419">419</span>
|
||||||
|
<span id="420">420</span>
|
||||||
|
<span id="421">421</span>
|
||||||
|
<span id="422">422</span>
|
||||||
|
<span id="423">423</span>
|
||||||
|
<span id="424">424</span>
|
||||||
|
<span id="425">425</span>
|
||||||
|
<span id="426">426</span>
|
||||||
|
<span id="427">427</span>
|
||||||
|
<span id="428">428</span>
|
||||||
|
<span id="429">429</span>
|
||||||
|
<span id="430">430</span>
|
||||||
|
<span id="431">431</span>
|
||||||
|
<span id="432">432</span>
|
||||||
|
<span id="433">433</span>
|
||||||
|
<span id="434">434</span>
|
||||||
|
<span id="435">435</span>
|
||||||
|
<span id="436">436</span>
|
||||||
|
<span id="437">437</span>
|
||||||
|
<span id="438">438</span>
|
||||||
|
<span id="439">439</span>
|
||||||
|
<span id="440">440</span>
|
||||||
|
<span id="441">441</span>
|
||||||
|
<span id="442">442</span>
|
||||||
|
<span id="443">443</span>
|
||||||
|
<span id="444">444</span>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # parser</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The duck script parser.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./parser_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">parser_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">io</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">preprocessor</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::{<span class="ident">ErrorInfo</span>, <span class="ident">ScriptError</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">instruction</span>::{
|
||||||
|
<span class="ident">Instruction</span>, <span class="ident">InstructionMetaInfo</span>, <span class="ident">InstructionType</span>, <span class="ident">PreProcessInstruction</span>, <span class="ident">ScriptInstruction</span>,
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">static</span> <span class="ident">COMMENT_PREFIX_STR</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"#"</span>;
|
||||||
|
<span class="kw">static</span> <span class="ident">PRE_PROCESS_PREFIX</span>: <span class="ident">char</span> <span class="op">=</span> <span class="string">'!'</span>;
|
||||||
|
<span class="kw">static</span> <span class="ident">LABEL_PREFIX</span>: <span class="ident">char</span> <span class="op">=</span> <span class="string">':'</span>;
|
||||||
|
|
||||||
|
<span class="doccomment">/// parses the file and returns a vector of instructions</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_file</span>(<span class="ident">file</span>: <span class="kw-2">&</span><span class="ident">str</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">Instruction</span><span class="op">></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">meta_info</span> <span class="op">=</span> <span class="ident">InstructionMetaInfo</span>::<span class="ident">new</span>();
|
||||||
|
<span class="ident">meta_info</span>.<span class="ident">source</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>.<span class="ident">to_string</span>());
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">io</span>::<span class="ident">read_text_file</span>(<span class="ident">file</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">text</span>) <span class="op">=></span> <span class="ident">parse_lines</span>(<span class="kw-2">&</span><span class="ident">text</span>, <span class="ident">meta_info</span>),
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// parses the provided script text and returns a vector of instructions</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_text</span>(<span class="ident">text</span>: <span class="kw-2">&</span><span class="ident">str</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">Instruction</span><span class="op">></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="ident">parse_lines</span>(<span class="kw-2">&</span><span class="ident">text</span>, <span class="ident">InstructionMetaInfo</span>::<span class="ident">new</span>())
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_lines</span>(
|
||||||
|
<span class="ident">lines</span>: <span class="kw-2">&</span><span class="ident">str</span>,
|
||||||
|
<span class="ident">meta_info</span>: <span class="ident">InstructionMetaInfo</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">Instruction</span><span class="op">></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">instructions</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">line_number</span> <span class="op">=</span> <span class="number">1</span>;
|
||||||
|
<span class="kw">for</span> <span class="ident">line</span> <span class="kw">in</span> <span class="ident">lines</span>.<span class="ident">lines</span>() {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">line_meta_info</span> <span class="op">=</span> <span class="ident">meta_info</span>.<span class="ident">clone</span>();
|
||||||
|
<span class="ident">line_meta_info</span>.<span class="ident">line</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">line_number</span>);
|
||||||
|
<span class="ident">line_number</span> <span class="op">=</span> <span class="ident">line_number</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_line</span>(<span class="kw-2">&</span><span class="ident">line</span>, <span class="ident">line_meta_info</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">instruction</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">instructions</span>.<span class="ident">push</span>(<span class="ident">instruction</span>.<span class="ident">clone</span>());
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">instruction</span>.<span class="ident">instruction_type</span> {
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">PreProcess</span>(<span class="kw">_</span>) <span class="op">=></span> <span class="kw">match</span> <span class="ident">preprocessor</span>::<span class="ident">run</span>(<span class="kw-2">&</span><span class="ident">instruction</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="kw-2">mut</span> <span class="ident">added_instructions</span>) <span class="op">=></span> <span class="ident">instructions</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">added_instructions</span>),
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
},
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">instructions</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_line</span>(<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">meta_info</span>: <span class="ident">InstructionMetaInfo</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Instruction</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">trimmed_text</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">trim</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">trimmed_text</span>.<span class="ident">is_empty</span>() <span class="op">||</span> <span class="ident">trimmed_text</span>.<span class="ident">starts_with</span>(<span class="kw-2">&</span><span class="ident">COMMENT_PREFIX_STR</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">Instruction</span> {
|
||||||
|
<span class="ident">meta_info</span>,
|
||||||
|
<span class="ident">instruction_type</span>: <span class="ident">InstructionType</span>::<span class="ident">Empty</span>,
|
||||||
|
})
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">chars</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span> <span class="op">=</span> <span class="ident">trimmed_text</span>.<span class="ident">chars</span>().<span class="ident">collect</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">chars</span>[<span class="number">0</span>] <span class="op">==</span> <span class="ident">PRE_PROCESS_PREFIX</span> {
|
||||||
|
<span class="ident">parse_pre_process_line</span>(<span class="kw-2">&</span><span class="ident">chars</span>, <span class="ident">meta_info</span>, <span class="number">1</span>)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">parse_command_line</span>(<span class="kw-2">&</span><span class="ident">chars</span>, <span class="ident">meta_info</span>, <span class="number">0</span>)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_pre_process_line</span>(
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">meta_info</span>: <span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Instruction</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">line_text</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">PreProcessNoCommandFound</span>(<span class="ident">meta_info</span>),
|
||||||
|
})
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">start_index</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">end_index</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">len</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">_i</span> <span class="kw">in</span> <span class="ident">index</span>..<span class="ident">end_index</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">character</span> <span class="op">=</span> <span class="ident">line_text</span>[<span class="ident">index</span>];
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">' '</span> {
|
||||||
|
<span class="kw">if</span> <span class="op">!</span><span class="ident">command</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">command</span>.<span class="ident">push</span>(<span class="ident">character</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">command</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">PreProcessNoCommandFound</span>(<span class="ident">meta_info</span>),
|
||||||
|
})
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_arguments</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">arguments</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">instruction</span> <span class="op">=</span> <span class="ident">PreProcessInstruction</span>::<span class="ident">new</span>();
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">command</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">command</span>);
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">arguments</span> <span class="op">=</span> <span class="ident">arguments</span>;
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">Instruction</span> {
|
||||||
|
<span class="ident">meta_info</span>,
|
||||||
|
<span class="ident">instruction_type</span>: <span class="ident">InstructionType</span>::<span class="ident">PreProcess</span>(<span class="ident">instruction</span>),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_command_line</span>(
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">meta_info</span>: <span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Instruction</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">end_index</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">len</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">line_text</span>.<span class="ident">is_empty</span>() <span class="op">||</span> <span class="ident">start_index</span> <span class="op">>=</span> <span class="ident">end_index</span> {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">Instruction</span> {
|
||||||
|
<span class="ident">meta_info</span>,
|
||||||
|
<span class="ident">instruction_type</span>: <span class="ident">InstructionType</span>::<span class="ident">Empty</span>,
|
||||||
|
})
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="comment">// search for label</span>
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">start_index</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">instruction</span> <span class="op">=</span> <span class="ident">ScriptInstruction</span>::<span class="ident">new</span>();
|
||||||
|
<span class="kw">match</span> <span class="ident">find_label</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">next_index</span>, <span class="ident">value</span>) <span class="op">=</span> <span class="ident">output</span>;
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">next_index</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">value</span>.<span class="ident">is_some</span>() {
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">label</span> <span class="op">=</span> <span class="ident">value</span>.<span class="ident">clone</span>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="comment">// find output variable and command</span>
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">find_output_and_command</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">instruction</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">next_index</span>) <span class="op">=></span> <span class="ident">next_index</span>,
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_arguments</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">arguments</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">arguments</span> <span class="op">=</span> <span class="ident">arguments</span>;
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">instruction_type</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">instruction</span>.<span class="ident">label</span>.<span class="ident">is_none</span>()
|
||||||
|
<span class="op">&&</span> <span class="ident">instruction</span>.<span class="ident">output</span>.<span class="ident">is_none</span>()
|
||||||
|
<span class="op">&&</span> <span class="ident">instruction</span>.<span class="ident">command</span>.<span class="ident">is_none</span>()
|
||||||
|
{
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">Empty</span>
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">Script</span>(<span class="ident">instruction</span>)
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">Instruction</span> {
|
||||||
|
<span class="ident">meta_info</span>,
|
||||||
|
<span class="ident">instruction_type</span>,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_arguments</span>(
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">>></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">arguments</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">start_index</span>;
|
||||||
|
<span class="kw">loop</span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_next_argument</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">next_index</span>, <span class="ident">argument</span>) <span class="op">=</span> <span class="ident">output</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">argument</span>.<span class="ident">is_none</span>() {
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="ident">arguments</span>.<span class="ident">push</span>(<span class="ident">argument</span>.<span class="ident">unwrap</span>());
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">next_index</span>;
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">arguments</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">arguments</span>))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_next_argument</span>(
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>), <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="ident">parse_next_value</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">start_index</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">parse_next_value</span>(
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
<span class="ident">allow_quotes</span>: <span class="ident">bool</span>,
|
||||||
|
<span class="ident">allow_control</span>: <span class="ident">bool</span>,
|
||||||
|
<span class="ident">stop_on_equals</span>: <span class="ident">bool</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>), <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">end_index</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">len</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">start_index</span> <span class="op">>=</span> <span class="ident">end_index</span> {
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">start_index</span>, <span class="prelude-val">None</span>))
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">argument</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">start_index</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">in_argument</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">using_quotes</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">in_control</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">found_end</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
<span class="kw">for</span> <span class="ident">_i</span> <span class="kw">in</span> <span class="ident">index</span>..<span class="ident">end_index</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">character</span> <span class="op">=</span> <span class="ident">line_text</span>[<span class="ident">index</span>];
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">in_argument</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">in_control</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'\\'</span> <span class="op">||</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'"'</span> {
|
||||||
|
<span class="ident">argument</span>.<span class="ident">push</span>(<span class="ident">character</span>);
|
||||||
|
<span class="ident">in_control</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">ControlWithoutValidValue</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'\\'</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">allow_control</span> {
|
||||||
|
<span class="ident">in_control</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">InvalidControlLocation</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">using_quotes</span> <span class="op">&&</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'"'</span> {
|
||||||
|
<span class="ident">found_end</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="op">!</span><span class="ident">using_quotes</span>
|
||||||
|
<span class="op">&&</span> (<span class="ident">character</span> <span class="op">==</span> <span class="string">' '</span>
|
||||||
|
<span class="op">||</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'#'</span>
|
||||||
|
<span class="op">||</span> (<span class="ident">stop_on_equals</span> <span class="op">&&</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'='</span>))
|
||||||
|
{
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">' '</span> <span class="op">||</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'='</span> {
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">-</span> <span class="number">1</span>;
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'#'</span> {
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">end_index</span>;
|
||||||
|
}
|
||||||
|
<span class="ident">found_end</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">argument</span>.<span class="ident">push</span>(<span class="ident">character</span>);
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'#'</span> {
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">end_index</span>;
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">!=</span> <span class="string">' '</span> {
|
||||||
|
<span class="ident">in_argument</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'"'</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">allow_quotes</span> {
|
||||||
|
<span class="ident">using_quotes</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">InvalidQuotesLocation</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'\\'</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">allow_control</span> {
|
||||||
|
<span class="ident">in_control</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">InvalidControlLocation</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">argument</span>.<span class="ident">push</span>(<span class="ident">character</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">in_argument</span> <span class="op">&&</span> <span class="op">!</span><span class="ident">found_end</span> <span class="op">&&</span> (<span class="ident">in_control</span> <span class="op">||</span> <span class="ident">using_quotes</span>) {
|
||||||
|
<span class="kw">if</span> <span class="ident">in_control</span> {
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">ControlWithoutValidValue</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
})
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">MissingEndQuotes</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">argument</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="kw">if</span> <span class="ident">using_quotes</span> {
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">index</span>, <span class="prelude-val">Some</span>(<span class="ident">argument</span>)))
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">index</span>, <span class="prelude-val">None</span>))
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">index</span>, <span class="prelude-val">Some</span>(<span class="ident">argument</span>)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">find_label</span>(
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>), <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">end_index</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">len</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">start_index</span> <span class="op">>=</span> <span class="ident">end_index</span> {
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">start_index</span>, <span class="prelude-val">None</span>))
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">label</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">start_index</span>;
|
||||||
|
<span class="kw">for</span> <span class="ident">_i</span> <span class="kw">in</span> <span class="ident">index</span>..<span class="ident">end_index</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">character</span> <span class="op">=</span> <span class="ident">line_text</span>[<span class="ident">index</span>];
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="ident">LABEL_PREFIX</span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_next_value</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">next_index</span>, <span class="ident">value</span>) <span class="op">=</span> <span class="ident">output</span>;
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">next_index</span>;
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">value</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">label_value</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">label_value</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">EmptyLabel</span>(<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">text</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
||||||
|
<span class="ident">text</span>.<span class="ident">push</span>(<span class="ident">LABEL_PREFIX</span>);
|
||||||
|
<span class="ident">text</span>.<span class="ident">push_str</span>(<span class="kw-2">&</span><span class="ident">label_value</span>);
|
||||||
|
|
||||||
|
<span class="ident">label</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">text</span>);
|
||||||
|
}
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> (),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
};
|
||||||
|
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">character</span> <span class="op">!=</span> <span class="string">' '</span> {
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">-</span> <span class="number">1</span>;
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>((<span class="ident">index</span>, <span class="ident">label</span>))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">find_output_and_command</span>(
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">line_text</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">char</span><span class="op">></span>,
|
||||||
|
<span class="ident">start_index</span>: <span class="ident">usize</span>,
|
||||||
|
<span class="ident">instruction</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">ScriptInstruction</span>,
|
||||||
|
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">usize</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_next_value</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">start_index</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">next_index</span>, <span class="ident">value</span>) <span class="op">=</span> <span class="ident">output</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">value</span>.<span class="ident">is_none</span>() {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">next_index</span>)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">next_index</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">end_index</span> <span class="op">=</span> <span class="ident">line_text</span>.<span class="ident">len</span>();
|
||||||
|
<span class="kw">for</span> <span class="ident">_i</span> <span class="kw">in</span> <span class="ident">index</span>..<span class="ident">end_index</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">character</span> <span class="op">=</span> <span class="ident">line_text</span>[<span class="ident">index</span>];
|
||||||
|
<span class="ident">index</span> <span class="op">=</span> <span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">!=</span> <span class="string">' '</span> {
|
||||||
|
<span class="kw">if</span> <span class="ident">character</span> <span class="op">==</span> <span class="string">'='</span> {
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">output</span> <span class="op">=</span> <span class="ident">value</span>.<span class="ident">clone</span>();
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">instruction</span>.<span class="ident">output</span>.<span class="ident">is_some</span>() {
|
||||||
|
<span class="kw">match</span> <span class="ident">parse_next_value</span>(<span class="kw-2">&</span><span class="ident">meta_info</span>, <span class="kw-2">&</span><span class="ident">line_text</span>, <span class="ident">index</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">next_index</span>, <span class="ident">value</span>) <span class="op">=</span> <span class="ident">output</span>;
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="ident">value</span>.<span class="ident">is_none</span>() {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">index</span>)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">command</span> <span class="op">=</span> <span class="ident">value</span>.<span class="ident">clone</span>();
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">next_index</span>)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">instruction</span>.<span class="ident">command</span> <span class="op">=</span> <span class="ident">value</span>.<span class="ident">clone</span>();
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">next_index</span>)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,113 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/preprocessor/include_files_preprocessor.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>include_files_preprocessor.rs.html -- source</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # include_files_preprocessor</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! Enables to load and include additional source files.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">parser</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::<span class="ident">ScriptError</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">instruction</span>::{<span class="ident">Instruction</span>, <span class="ident">InstructionMetaInfo</span>};
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;
|
||||||
|
|
||||||
|
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">run</span>(
|
||||||
|
<span class="ident">arguments</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">>></span>,
|
||||||
|
<span class="ident">meta_info</span>: <span class="kw-2">&</span><span class="ident">InstructionMetaInfo</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">Instruction</span><span class="op">></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">instructions</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">arguments_vec</span>) <span class="op">=</span> <span class="ident">arguments</span> {
|
||||||
|
<span class="kw">for</span> <span class="ident">argument</span> <span class="kw">in</span> <span class="ident">arguments_vec</span> {
|
||||||
|
<span class="comment">// get file based on parent file location</span>
|
||||||
|
<span class="kw">let</span> <span class="ident">file_path</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">argument</span>.<span class="ident">starts_with</span>(<span class="string">"/"</span>) <span class="op">||</span> <span class="ident">argument</span>.<span class="ident">starts_with</span>(<span class="string">"\\"</span>) {
|
||||||
|
<span class="ident">argument</span>.<span class="ident">to_string</span>()
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">match</span> <span class="kw-2">&</span><span class="ident">meta_info</span>.<span class="ident">source</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">value</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">path_buffer</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="kw-2">&</span><span class="ident">value</span>);
|
||||||
|
<span class="kw">match</span> <span class="ident">path_buffer</span>.<span class="ident">parent</span>() {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">parent_path_buffer</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">to_path_buf</span>();
|
||||||
|
<span class="ident">parent_path_buffer</span>.<span class="ident">push</span>(<span class="kw-2">&</span><span class="ident">argument</span>);
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">full_path_buffer</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">parent_path_buffer</span>.<span class="ident">canonicalize</span>() {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">new_buffer</span>) <span class="op">=></span> <span class="ident">new_buffer</span>,
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> <span class="ident">parent_path_buffer</span>,
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="ident">full_path_buffer</span>.<span class="ident">to_string_lossy</span>().<span class="ident">into_owned</span>()
|
||||||
|
}
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> <span class="ident">argument</span>.<span class="ident">to_string</span>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">argument</span>.<span class="ident">to_string</span>(),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">parser</span>::<span class="ident">parse_file</span>(<span class="kw-2">&</span><span class="ident">file_path</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="kw-2">mut</span> <span class="ident">additional_instructions</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">instructions</span>.<span class="ident">append</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">additional_instructions</span>)
|
||||||
|
}
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">instructions</span>)
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
81
docs/api/duckscript/src/duckscript/preprocessor/mod.rs.html
Normal file
81
docs/api/duckscript/src/duckscript/preprocessor/mod.rs.html
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/preprocessor/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs.html -- source</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # preprocessor</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The pre processor is invoked on parse time by the script parser.</span>
|
||||||
|
<span class="doccomment">//! Currently it provide only limited amount of commands and it is not meant to be extendable.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./mod_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">mod_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">mod</span> <span class="ident">include_files_preprocessor</span>;
|
||||||
|
<span class="kw">mod</span> <span class="ident">print_preprocessor</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::{<span class="ident">ErrorInfo</span>, <span class="ident">ScriptError</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">instruction</span>::{<span class="ident">Instruction</span>, <span class="ident">InstructionType</span>};
|
||||||
|
|
||||||
|
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">run</span>(<span class="ident">instruction</span>: <span class="kw-2">&</span><span class="ident">Instruction</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">Instruction</span><span class="op">></span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">instruction</span>.<span class="ident">instruction_type</span> {
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">PreProcess</span>(<span class="kw-2">ref</span> <span class="ident">instruction_type</span>) <span class="op">=></span> <span class="kw">match</span> <span class="kw-2">&</span><span class="ident">instruction_type</span>.<span class="ident">command</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">command</span>) <span class="op">=></span> <span class="kw">match</span> <span class="ident">command</span>.<span class="ident">as_ref</span>() {
|
||||||
|
<span class="string">"print"</span> <span class="op">=></span> {
|
||||||
|
<span class="ident">print_preprocessor</span>::<span class="ident">run</span>(<span class="kw-2">&</span><span class="ident">instruction_type</span>.<span class="ident">arguments</span>);
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[])
|
||||||
|
}
|
||||||
|
<span class="string">"include_files"</span> <span class="op">=></span> <span class="ident">include_files_preprocessor</span>::<span class="ident">run</span>(
|
||||||
|
<span class="kw-2">&</span><span class="ident">instruction_type</span>.<span class="ident">arguments</span>,
|
||||||
|
<span class="kw-2">&</span><span class="ident">instruction</span>.<span class="ident">meta_info</span>,
|
||||||
|
),
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">UnknownPreProcessorCommand</span>(<span class="ident">instruction</span>.<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">PreProcessNoCommandFound</span>(<span class="ident">instruction</span>.<span class="ident">meta_info</span>.<span class="ident">clone</span>()),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[]),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/preprocessor/print_preprocessor.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>print_preprocessor.rs.html -- source</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # print_preprocessor</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The print pre processor implementation.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">run</span>(<span class="ident">arguments</span>: <span class="kw-2">&</span><span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">>></span>) {
|
||||||
|
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">arguments_vec</span>) <span class="op">=</span> <span class="ident">arguments</span> {
|
||||||
|
<span class="kw">for</span> <span class="ident">argument</span> <span class="kw">in</span> <span class="ident">arguments_vec</span> {
|
||||||
|
<span class="macro">print</span><span class="macro">!</span>(<span class="string">"{} "</span>, <span class="ident">argument</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="macro">println</span><span class="macro">!</span>(<span class="string">""</span>);
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
439
docs/api/duckscript/src/duckscript/runner.rs.html
Normal file
439
docs/api/duckscript/src/duckscript/runner.rs.html
Normal file
|
@ -0,0 +1,439 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/runner.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>runner.rs.html -- source</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../duckscript/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # runner</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The main entry point which enables running scripts.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./runner_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">runner_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">expansion</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">parser</span>;
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">command</span>::{<span class="ident">CommandResult</span>, <span class="ident">GoToValue</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::{<span class="ident">ErrorInfo</span>, <span class="ident">ScriptError</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">instruction</span>::{<span class="ident">Instruction</span>, <span class="ident">InstructionType</span>, <span class="ident">ScriptInstruction</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">runtime</span>::{<span class="ident">Context</span>, <span class="ident">Runtime</span>, <span class="ident">StateValue</span>};
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||||
|
|
||||||
|
<span class="doccomment">/// Executes the provided script with the given context</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">run_script</span>(<span class="ident">text</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">context</span>: <span class="ident">Context</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Context</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parser</span>::<span class="ident">parse_text</span>(<span class="ident">text</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">instructions</span>) <span class="op">=></span> <span class="ident">run</span>(<span class="ident">instructions</span>, <span class="ident">context</span>),
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Executes the provided script file with the given context</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">run_script_file</span>(<span class="ident">file</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">context</span>: <span class="ident">Context</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Context</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">parser</span>::<span class="ident">parse_file</span>(<span class="ident">file</span>) {
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">instructions</span>) <span class="op">=></span> <span class="ident">run</span>(<span class="ident">instructions</span>, <span class="ident">context</span>),
|
||||||
|
<span class="prelude-val">Err</span>(<span class="ident">error</span>) <span class="op">=></span> <span class="prelude-val">Err</span>(<span class="ident">error</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">run</span>(<span class="ident">instructions</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Instruction</span><span class="op">></span>, <span class="ident">context</span>: <span class="ident">Context</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Context</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">runtime</span> <span class="op">=</span> <span class="ident">create_runtime</span>(<span class="ident">instructions</span>, <span class="ident">context</span>);
|
||||||
|
|
||||||
|
<span class="ident">run_instructions</span>(<span class="ident">runtime</span>, <span class="number">0</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">create_runtime</span>(<span class="ident">instructions</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Instruction</span><span class="op">></span>, <span class="ident">context</span>: <span class="ident">Context</span>) <span class="op">-></span> <span class="ident">Runtime</span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">runtime</span> <span class="op">=</span> <span class="ident">Runtime</span>::<span class="ident">new</span>(<span class="ident">context</span>);
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">line</span> <span class="op">=</span> <span class="number">0</span>;
|
||||||
|
<span class="kw">for</span> <span class="ident">instruction</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">instructions</span> {
|
||||||
|
<span class="kw">match</span> <span class="kw-2">&</span><span class="ident">instruction</span>.<span class="ident">instruction_type</span> {
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">Script</span>(<span class="kw-2">ref</span> <span class="ident">value</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">match</span> <span class="ident">value</span>.<span class="ident">label</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">label</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">runtime</span>.<span class="ident">label_to_line</span>.<span class="ident">insert</span>(<span class="ident">label</span>.<span class="ident">to_string</span>(), <span class="ident">line</span>);
|
||||||
|
()
|
||||||
|
}
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> (),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
<span class="kw">_</span> <span class="op">=></span> (),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="ident">line</span> <span class="op">=</span> <span class="ident">line</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="ident">runtime</span>.<span class="ident">instructions</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">instructions</span>);
|
||||||
|
|
||||||
|
<span class="ident">runtime</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">run_instructions</span>(<span class="kw-2">mut</span> <span class="ident">runtime</span>: <span class="ident">Runtime</span>, <span class="ident">start_at</span>: <span class="ident">usize</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Context</span>, <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">line</span> <span class="op">=</span> <span class="ident">start_at</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">state</span> <span class="op">=</span> <span class="ident">runtime</span>.<span class="ident">context</span>.<span class="ident">state</span>.<span class="ident">clone</span>();
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">instructions</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">runtime</span>.<span class="ident">instructions</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">instructions</span>) <span class="op">=></span> <span class="ident">instructions</span>,
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">runtime</span>.<span class="ident">context</span>),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">loop</span> {
|
||||||
|
<span class="kw">let</span> (<span class="ident">instruction</span>, <span class="ident">meta_info</span>) <span class="op">=</span> <span class="kw">if</span> <span class="ident">instructions</span>.<span class="ident">len</span>() <span class="op">></span> <span class="ident">line</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">instruction</span> <span class="op">=</span> <span class="ident">instructions</span>[<span class="ident">line</span>].<span class="ident">clone</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">meta_info</span> <span class="op">=</span> <span class="ident">instruction</span>.<span class="ident">meta_info</span>.<span class="ident">clone</span>();
|
||||||
|
(<span class="ident">instruction</span>, <span class="ident">meta_info</span>)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">let</span> (<span class="ident">command_result</span>, <span class="ident">output_variable</span>) <span class="op">=</span> <span class="ident">run_instruction</span>(
|
||||||
|
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">runtime</span>.<span class="ident">context</span>,
|
||||||
|
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">state</span>,
|
||||||
|
<span class="kw-2">&</span><span class="ident">instructions</span>,
|
||||||
|
<span class="ident">instruction</span>,
|
||||||
|
<span class="ident">line</span>,
|
||||||
|
);
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">command_result</span> {
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">Exit</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">update_output</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">runtime</span>.<span class="ident">context</span>, <span class="ident">output_variable</span>, <span class="ident">output</span>);
|
||||||
|
|
||||||
|
<span class="kw">break</span>;
|
||||||
|
}
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">Error</span>(<span class="ident">error</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">Runtime</span>(<span class="ident">error</span>, <span class="prelude-val">Some</span>(<span class="ident">meta_info</span>)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">Continue</span>(<span class="ident">output</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">update_output</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">runtime</span>.<span class="ident">context</span>, <span class="ident">output_variable</span>, <span class="ident">output</span>);
|
||||||
|
|
||||||
|
<span class="ident">line</span> <span class="op">=</span> <span class="ident">line</span> <span class="op">+</span> <span class="number">1</span>;
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">GoTo</span>(<span class="ident">output</span>, <span class="ident">goto_value</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">update_output</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">runtime</span>.<span class="ident">context</span>, <span class="ident">output_variable</span>, <span class="ident">output</span>);
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">goto_value</span> {
|
||||||
|
<span class="ident">GoToValue</span>::<span class="ident">Label</span>(<span class="ident">label</span>) <span class="op">=></span> <span class="kw">match</span> <span class="ident">runtime</span>.<span class="ident">label_to_line</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">label</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">value</span>) <span class="op">=></span> <span class="ident">line</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">value</span>,
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">Runtime</span>(
|
||||||
|
<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Label: {} not found."</span>, <span class="ident">label</span>),
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">meta_info</span>),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
<span class="ident">GoToValue</span>::<span class="ident">Line</span>(<span class="ident">line_number</span>) <span class="op">=></span> <span class="ident">line</span> <span class="op">=</span> <span class="ident">line_number</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="ident">runtime</span>.<span class="ident">context</span>.<span class="ident">state</span> <span class="op">=</span> <span class="ident">state</span>;
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(<span class="ident">runtime</span>.<span class="ident">context</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">update_output</span>(<span class="ident">context</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Context</span>, <span class="ident">output_variable</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>, <span class="ident">output</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) {
|
||||||
|
<span class="kw">if</span> <span class="ident">output_variable</span>.<span class="ident">is_some</span>() {
|
||||||
|
<span class="kw">match</span> <span class="ident">output</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">value</span>) <span class="op">=></span> <span class="ident">context</span>.<span class="ident">variables</span>.<span class="ident">insert</span>(<span class="ident">output_variable</span>.<span class="ident">unwrap</span>(), <span class="ident">value</span>),
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">context</span>.<span class="ident">variables</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">output_variable</span>.<span class="ident">unwrap</span>()),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">run_instruction</span>(
|
||||||
|
<span class="ident">context</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Context</span>,
|
||||||
|
<span class="ident">state</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">StateValue</span><span class="op">></span>,
|
||||||
|
<span class="ident">instructions</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Instruction</span><span class="op">></span>,
|
||||||
|
<span class="ident">instruction</span>: <span class="ident">Instruction</span>,
|
||||||
|
<span class="ident">line</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> (<span class="ident">CommandResult</span>, <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">commands</span> <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">context</span>.<span class="ident">commands</span>;
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">variables</span> <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">context</span>.<span class="ident">variables</span>;
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">output_variable</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||||
|
<span class="kw">let</span> <span class="ident">command_result</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">instruction</span>.<span class="ident">instruction_type</span> {
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">Empty</span> <span class="op">=></span> <span class="ident">CommandResult</span>::<span class="ident">Continue</span>(<span class="prelude-val">None</span>),
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">PreProcess</span>(<span class="kw">_</span>) <span class="op">=></span> <span class="ident">CommandResult</span>::<span class="ident">Continue</span>(<span class="prelude-val">None</span>),
|
||||||
|
<span class="ident">InstructionType</span>::<span class="ident">Script</span>(<span class="kw-2">ref</span> <span class="ident">script_instruction</span>) <span class="op">=></span> {
|
||||||
|
<span class="ident">output_variable</span> <span class="op">=</span> <span class="ident">script_instruction</span>.<span class="ident">output</span>.<span class="ident">clone</span>();
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">script_instruction</span>.<span class="ident">command</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">command</span>) <span class="op">=></span> <span class="kw">match</span> <span class="ident">commands</span>.<span class="ident">get_for_use</span>(<span class="ident">command</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">command_instance</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">command_arguments</span> <span class="op">=</span>
|
||||||
|
<span class="ident">bind_command_arguments</span>(<span class="kw-2">&</span><span class="ident">variables</span>, <span class="kw-2">&</span><span class="ident">script_instruction</span>);
|
||||||
|
|
||||||
|
<span class="kw">let</span> <span class="ident">command_result</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">command_instance</span>.<span class="ident">requires_context</span>() {
|
||||||
|
<span class="kw">let</span> <span class="ident">meta_info_clone</span> <span class="op">=</span> <span class="ident">instruction</span>.<span class="ident">meta_info</span>.<span class="ident">clone</span>();
|
||||||
|
<span class="ident">command_instance</span>.<span class="ident">run_with_context</span>(
|
||||||
|
<span class="ident">command_arguments</span>,
|
||||||
|
<span class="ident">state</span>,
|
||||||
|
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">variables</span>,
|
||||||
|
<span class="ident">output_variable</span>.<span class="ident">clone</span>(),
|
||||||
|
<span class="kw-2">&</span><span class="ident">instructions</span>,
|
||||||
|
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">commands</span>,
|
||||||
|
<span class="ident">meta_info_clone</span>,
|
||||||
|
<span class="ident">line</span>,
|
||||||
|
)
|
||||||
|
} <span class="kw">else</span> {
|
||||||
|
<span class="ident">command_instance</span>.<span class="ident">run</span>(<span class="ident">command_arguments</span>)
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="ident">commands</span>.<span class="ident">return_after_usage</span>(<span class="ident">command_instance</span>);
|
||||||
|
|
||||||
|
<span class="ident">command_result</span>
|
||||||
|
}
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">CommandResult</span>::<span class="ident">Error</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Command: {} not found."</span>, <span class="kw-2">&</span><span class="ident">command</span>)),
|
||||||
|
},
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">CommandResult</span>::<span class="ident">Continue</span>(<span class="prelude-val">None</span>),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
(<span class="ident">command_result</span>, <span class="ident">output_variable</span>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">fn</span> <span class="ident">bind_command_arguments</span>(
|
||||||
|
<span class="ident">variables</span>: <span class="kw-2">&</span><span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span>,
|
||||||
|
<span class="ident">instruction</span>: <span class="kw-2">&</span><span class="ident">ScriptInstruction</span>,
|
||||||
|
) <span class="op">-></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">arguments</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="ident">instruction</span>.<span class="ident">arguments</span> {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">arguments_ref</span>) <span class="op">=></span> {
|
||||||
|
<span class="kw">for</span> <span class="ident">argument</span> <span class="kw">in</span> <span class="ident">arguments_ref</span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">expansion</span>::<span class="ident">expand_by_wrapper</span>(<span class="kw-2">&</span><span class="ident">argument</span>, <span class="string">"${"</span>, <span class="string">'}'</span>, <span class="ident">variables</span>);
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="op">!</span><span class="ident">value</span>.<span class="ident">is_empty</span>() {
|
||||||
|
<span class="ident">arguments</span>.<span class="ident">push</span>(<span class="ident">value</span>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> (),
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="ident">arguments</span>
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "duckscript";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
351
docs/api/duckscript/src/duckscript/types/command.rs.html
Normal file
351
docs/api/duckscript/src/duckscript/types/command.rs.html
Normal file
|
@ -0,0 +1,351 @@
|
||||||
|
<!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 to the Rust file `duckscript/src/types/command.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>command.rs.html -- source</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../duckscript/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><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><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><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>
|
||||||
|
</pre><div class="example-wrap"><pre class="rust ">
|
||||||
|
<span class="doccomment">//! # command</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
<span class="doccomment">//! The command trait and access module.</span>
|
||||||
|
<span class="doccomment">//!</span>
|
||||||
|
|
||||||
|
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
||||||
|
<span class="attribute">#[<span class="ident">path</span> <span class="op">=</span> <span class="string">"./command_test.rs"</span>]</span>
|
||||||
|
<span class="kw">mod</span> <span class="ident">command_test</span>;
|
||||||
|
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">error</span>::{<span class="ident">ErrorInfo</span>, <span class="ident">ScriptError</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">instruction</span>::{<span class="ident">Instruction</span>, <span class="ident">InstructionMetaInfo</span>};
|
||||||
|
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">types</span>::<span class="ident">runtime</span>::<span class="ident">StateValue</span>;
|
||||||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||||
|
|
||||||
|
<span class="doccomment">/// GoTo type value</span>
|
||||||
|
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">GoToValue</span> {
|
||||||
|
<span class="doccomment">/// label target</span>
|
||||||
|
<span class="ident">Label</span>(<span class="ident">String</span>),
|
||||||
|
<span class="doccomment">/// Line number</span>
|
||||||
|
<span class="ident">Line</span>(<span class="ident">usize</span>),
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Command execution result</span>
|
||||||
|
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>)]</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">CommandResult</span> {
|
||||||
|
<span class="doccomment">/// Holds the command output and tells the runner to continue to next instruction</span>
|
||||||
|
<span class="ident">Continue</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>),
|
||||||
|
<span class="doccomment">/// Holds the command output and tells the runner to jump to the provided label</span>
|
||||||
|
<span class="ident">GoTo</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>, <span class="ident">GoToValue</span>),
|
||||||
|
<span class="doccomment">/// Holds the error message and the meta info of the instruction that caused it</span>
|
||||||
|
<span class="ident">Error</span>(<span class="ident">String</span>),
|
||||||
|
<span class="doccomment">/// Holds the command output and tells the runner to stop the script execution</span>
|
||||||
|
<span class="ident">Exit</span>(<span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>),
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Defines the command capabilities</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">Command</span> {
|
||||||
|
<span class="doccomment">/// The full command name which can be used to invoke this command</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">name</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">String</span>;
|
||||||
|
|
||||||
|
<span class="doccomment">/// A list of aliases that can also be used to invoke this command</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">aliases</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
|
||||||
|
<span class="macro">vec</span><span class="macro">!</span>[]
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Command documentation</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">help</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">String</span> {
|
||||||
|
<span class="macro">format</span><span class="macro">!</span>(<span class="string">"No documentation found for command: {}"</span>, <span class="self">self</span>.<span class="ident">name</span>())
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// If true the run with the context will be invoked</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">requires_context</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">bool</span> {
|
||||||
|
<span class="bool-val">false</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Runs the given instruction</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">run</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">_arguments</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-></span> <span class="ident">CommandResult</span> {
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">Error</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Not implemented for command: {}"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">name</span>()).<span class="ident">to_string</span>())
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Run the instruction with access to the runtime context</span>
|
||||||
|
<span class="kw">fn</span> <span class="ident">run_with_context</span>(
|
||||||
|
<span class="kw-2">&</span><span class="self">self</span>,
|
||||||
|
<span class="ident">_arguments</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||||
|
<span class="ident">_state</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">StateValue</span><span class="op">></span>,
|
||||||
|
<span class="ident">_variables</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span>,
|
||||||
|
<span class="ident">_output_variable</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
||||||
|
<span class="ident">_instructions</span>: <span class="kw-2">&</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">Instruction</span><span class="op">></span>,
|
||||||
|
<span class="ident">_commands</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Commands</span>,
|
||||||
|
<span class="ident">_meta_info</span>: <span class="ident">InstructionMetaInfo</span>,
|
||||||
|
<span class="ident">_line</span>: <span class="ident">usize</span>,
|
||||||
|
) <span class="op">-></span> <span class="ident">CommandResult</span> {
|
||||||
|
<span class="ident">CommandResult</span>::<span class="ident">Error</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Not implemented for command: {}"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">name</span>()).<span class="ident">to_string</span>())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Holds and enables access to the runtime commands implementations</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Commands</span> {
|
||||||
|
<span class="doccomment">/// mapping between command names to implementations</span>
|
||||||
|
<span class="kw">pub</span> <span class="ident">commands</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Command</span><span class="op">>></span>,
|
||||||
|
<span class="doccomment">/// mapping between aliases to command names</span>
|
||||||
|
<span class="kw">pub</span> <span class="ident">aliases</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span>,
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">impl</span> <span class="ident">Commands</span> {
|
||||||
|
<span class="doccomment">/// Creates and returns a new instance.</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() <span class="op">-></span> <span class="ident">Commands</span> {
|
||||||
|
<span class="ident">Commands</span> {
|
||||||
|
<span class="ident">commands</span>: <span class="ident">HashMap</span>::<span class="ident">new</span>(),
|
||||||
|
<span class="ident">aliases</span>: <span class="ident">HashMap</span>::<span class="ident">new</span>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Returns the command after it was being used.</span>
|
||||||
|
<span class="doccomment">/// No validations will be made.</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">return_after_usage</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">command</span>: <span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Command</span><span class="op">></span>) {
|
||||||
|
<span class="kw">let</span> <span class="ident">name</span> <span class="op">=</span> <span class="ident">command</span>.<span class="ident">name</span>();
|
||||||
|
|
||||||
|
<span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">insert</span>(<span class="ident">name</span>.<span class="ident">clone</span>(), <span class="ident">command</span>);
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Adds a new command definition.</span>
|
||||||
|
<span class="doccomment">/// It will fail in case another command already defined the same name/aliases</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">command</span>: <span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Command</span><span class="op">></span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">ScriptError</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">name</span> <span class="op">=</span> <span class="ident">command</span>.<span class="ident">name</span>();
|
||||||
|
<span class="kw">let</span> <span class="ident">aliases</span> <span class="op">=</span> <span class="ident">command</span>.<span class="ident">aliases</span>();
|
||||||
|
|
||||||
|
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">contains_key</span>(<span class="kw-2">&</span><span class="ident">name</span>) {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">Initialization</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"Command: {} already defined."</span>, <span class="kw-2">&</span><span class="ident">name</span>)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="kw">for</span> <span class="ident">alias</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">aliases</span> {
|
||||||
|
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">aliases</span>.<span class="ident">contains_key</span>(<span class="ident">alias</span>) {
|
||||||
|
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">ScriptError</span> {
|
||||||
|
<span class="ident">info</span>: <span class="ident">ErrorInfo</span>::<span class="ident">Initialization</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||||
|
<span class="string">"Alias: {} for command: {} already defined."</span>,
|
||||||
|
<span class="kw-2">&</span><span class="ident">alias</span>, <span class="kw-2">&</span><span class="ident">name</span>
|
||||||
|
)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">insert</span>(<span class="ident">name</span>.<span class="ident">clone</span>(), <span class="ident">command</span>);
|
||||||
|
|
||||||
|
<span class="kw">for</span> <span class="ident">alias</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">aliases</span> {
|
||||||
|
<span class="self">self</span>.<span class="ident">aliases</span>.<span class="ident">insert</span>(<span class="ident">alias</span>.<span class="ident">to_string</span>(), <span class="ident">name</span>.<span class="ident">clone</span>());
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="prelude-val">Ok</span>(())
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Return the command based on the given command name/alias</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Command</span><span class="op">>></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">command_name</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">aliases</span>.<span class="ident">get</span>(<span class="ident">name</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">value</span>) <span class="op">=></span> <span class="ident">value</span>,
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">name</span>,
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">get</span>(<span class="ident">command_name</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">value</span>) <span class="op">=></span> <span class="prelude-val">Some</span>(<span class="ident">value</span>.<span class="ident">clone</span>()),
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="prelude-val">None</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Return the command based on the given command name/alias.</span>
|
||||||
|
<span class="doccomment">/// It will also remove it in the process.</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_for_use</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Box</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">Command</span><span class="op">>></span> {
|
||||||
|
<span class="kw">let</span> <span class="ident">command_name</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">aliases</span>.<span class="ident">get</span>(<span class="ident">name</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">value</span>) <span class="op">=></span> <span class="ident">value</span>,
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="ident">name</span>,
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">remove</span>(<span class="ident">command_name</span>) {
|
||||||
|
<span class="prelude-val">Some</span>(<span class="ident">value</span>) <span class="op">=></span> <span class="prelude-val">Some</span>(<span class="ident">value</span>),
|
||||||
|
<span class="prelude-val">None</span> <span class="op">=></span> <span class="prelude-val">None</span>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="doccomment">/// Returns all the command names currently registered</span>
|
||||||
|
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_all_command_names</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
|
||||||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">names</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||||
|
|
||||||
|
<span class="kw">for</span> <span class="ident">key</span> <span class="kw">in</span> <span class="self">self</span>.<span class="ident">commands</span>.<span class="ident">keys</span>() {
|
||||||
|
<span class="ident">names</span>.<span class="ident">push</span>(<span class="ident">key</span>.<span class="ident">to_string</span>());
|
||||||
|
}
|
||||||
|
|
||||||
|
<span class="ident">names</span>.<span class="ident">sort</span>();
|
||||||
|
|
||||||
|
<span class="ident">names</span>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "duckscript";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue