pub struct Instruction {
pub prefix: Prefix,
pub name: Option<String>,
pub value: Value,
}
Expand description
An instruction. Used as a rusty way to parse arguments in build scripts.
Fields§
§prefix: Prefix
The prefix. Usually Cargo
.
name: Option<String>
The name of the instruction. Most of the time it’s filled in, only when a new mapping
new_mapping()
is created it’s not.
value: Value
The Value
of the Instruction.
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn new(name: &str, value: Value) -> Self
pub fn new(name: &str, value: Value) -> Self
Create a new Instruction. 99% of the time this should suffice instead of
new_mapping()
.
Sourcepub fn new_mapping(value: Value) -> Self
pub fn new_mapping(value: Value) -> Self
Create a new Instruction Mapping. Only 1% of the time is this proven useful, instead use new().
§Panics
This panics if value
is not a Mapping
or
UnquotedMapping
.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl Display for Instruction
impl Display for Instruction
Source§impl Hash for Instruction
impl Hash for Instruction
Source§impl Ord for Instruction
impl Ord for Instruction
Source§fn cmp(&self, other: &Instruction) -> Ordering
fn cmp(&self, other: &Instruction) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
Source§impl PartialOrd for Instruction
impl PartialOrd for Instruction
impl Eq for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
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