pub enum MetaValue {
Path(Path),
NameValue(MetaNameValue),
List(MetaList),
Lit(Lit),
}Expand description
A meta item.
Variants§
Implementations§
Source§impl MetaValue
impl MetaValue
Sourcepub fn path(&self) -> Result<&Path, Error>
pub fn path(&self) -> Result<&Path, Error>
Tries to take the value as a Path, returning an error if it isn’t
a path.
Sourcepub fn name_value(&self) -> Result<&MetaNameValue, Error>
pub fn name_value(&self) -> Result<&MetaNameValue, Error>
Tries to take the value as a MetaNameValue, returning an error if
it isn’t one.
Sourcepub fn lit(&self) -> Result<&Lit, Error>
pub fn lit(&self) -> Result<&Lit, Error>
Tries to take the value as a Lit, returning an error if it isn’t
a literal.
Sourcepub fn list(&self) -> Result<&MetaList, Error>
pub fn list(&self) -> Result<&MetaList, Error>
Tries to take the value as a [List], returning an error if it isn’t
a list.
Sourcepub fn value(&self) -> Result<&Lit, Error>
pub fn value(&self) -> Result<&Lit, Error>
Attempts to get the value of the MetaValue.
As the various variants that MetaValue provides:
MetaValue::Lit(lit):litis the value.MetaValue::NameValue(nv):nv.valueis the value.- Otherwise, a proper error is generated.
pub fn name(&self) -> Option<&Ident>
Trait Implementations§
Auto Trait Implementations§
impl !Send for MetaValue
impl !Sync for MetaValue
impl Freeze for MetaValue
impl RefUnwindSafe for MetaValue
impl Unpin for MetaValue
impl UnsafeUnpin for MetaValue
impl UnwindSafe for MetaValue
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