Struct yash_syntax::syntax::Assign
source · pub struct Assign {
pub name: String,
pub value: Value,
pub location: Location,
}
Expand description
Assignment word.
Fields§
§name: String
Name of the variable to assign to.
In the valid assignment syntax, the name must not be empty.
value: Value
Value assigned to the variable.
location: Location
Location of the assignment word.
Trait Implementations§
source§impl FromStr for Assign
impl FromStr for Assign
Converts a string to an assignment.
source§impl PartialEq for Assign
impl PartialEq for Assign
source§impl TryFrom<Word> for Assign
impl TryFrom<Word> for Assign
Fallible conversion from a word into an assignment.
source§fn try_from(word: Word) -> Result<Assign, Word>
fn try_from(word: Word) -> Result<Assign, Word>
Converts a word into an assignment.
For a successful conversion, the word must be of the form name=value
,
where name
is a non-empty literal word,
=
is an unquoted equal sign, and value
is a word. If the input word
does not match this syntax, it is returned intact in Err
.
impl Eq for Assign
impl StructuralPartialEq for Assign
Auto Trait Implementations§
impl Freeze for Assign
impl !RefUnwindSafe for Assign
impl !Send for Assign
impl !Sync for Assign
impl Unpin for Assign
impl !UnwindSafe for Assign
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more