pub struct Named<T> {
pub name: String,
pub value: T,
}
Expand description
A named value. Used for named parameters or variants.
Fields§
§name: String
§value: T
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Named<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Named<T>where
T: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Named<T>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Named<T>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> FormatHolder for Named<T>where
T: FormatHolder + Debug,
impl<T> FormatHolder for Named<T>where
T: FormatHolder + Debug,
Source§fn visit<'a>(
&'a self,
f: &mut dyn FnMut(&'a Format) -> Result<()>,
) -> Result<()>
fn visit<'a>( &'a self, f: &mut dyn FnMut(&'a Format) -> Result<()>, ) -> Result<()>
Visit all the formats in
self
in a depth-first way.
Variables are not supported and will cause an error.Source§fn visit_mut(
&mut self,
f: &mut dyn FnMut(&mut Format) -> Result<()>,
) -> Result<()>
fn visit_mut( &mut self, f: &mut dyn FnMut(&mut Format) -> Result<()>, ) -> Result<()>
Mutably visit all the formats in
self
in a depth-first way. Read moreSource§fn unify(&mut self, other: Named<T>) -> Result<()>
fn unify(&mut self, other: Named<T>) -> Result<()>
Update variables and add missing enum variants so that the terms match.
This is a special case of term unification: Read more
Source§fn is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
Whether this format is a variable with no known value yet.
impl<T: Eq> Eq for Named<T>
impl<T> StructuralPartialEq for Named<T>
Auto Trait Implementations§
impl<T> Freeze for Named<T>where
T: Freeze,
impl<T> RefUnwindSafe for Named<T>where
T: RefUnwindSafe,
impl<T> Send for Named<T>where
T: Send,
impl<T> Sync for Named<T>where
T: Sync,
impl<T> Unpin for Named<T>where
T: Unpin,
impl<T> UnwindSafe for Named<T>where
T: UnwindSafe,
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