Enum knightrs::Value [−][src]
pub enum Value { Null, Boolean(Boolean), Number(Number), Text(Text), Variable(Variable), Ast(Ast), }
Variants
Boolean(Boolean)
Number(Number)
Text(Text)
Variable(Variable)
Ast(Ast)
Implementations
impl Value
[src]
impl Value
[src]pub fn run(&self, env: &mut Environment<'_, '_, '_>) -> Result<Self>
[src]
#[must_use = "getting the type name by itself does nothing."]pub const fn typename(&self) -> &'static str
[src]
pub fn to_boolean(&self) -> Result<Boolean>
[src]
pub fn to_number(&self) -> Result<Number>
[src]
pub fn to_text(&self) -> Result<Text>
[src]
impl Value
[src]
impl Value
[src]pub fn parse_str<S: AsRef<str>>(
input: S,
env: &mut Environment<'_, '_, '_>
) -> Result<Self, ParseError>
[src]
pub fn parse_str<S: AsRef<str>>(
input: S,
env: &mut Environment<'_, '_, '_>
) -> Result<Self, ParseError>
[src]pub fn parse<S: IntoIterator<Item = char>>(
input: S,
env: &mut Environment<'_, '_, '_>
) -> Result<Self, ParseError>
[src]
pub fn parse<S: IntoIterator<Item = char>>(
input: S,
env: &mut Environment<'_, '_, '_>
) -> Result<Self, ParseError>
[src]Parses out a stream from the given input
within the context of env
.
Note: Yes, technically this could be an iterator over u8
, as the Knight specs clearly state that all source
bytes are a subset of ASCII. However, we may want to support fun stuff like non-ASCII variables as an optional
extension in the future. As such, char
is required.
Errors
This function returns any errors that occur whilst parsing; See ParseError
’s variants for what conditions can
cause errors.
See Also
Section 1. within the Knight specs for parsing.
Trait Implementations
impl Eq for Value
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,