Struct nu_source::Tagged [−][src]
pub struct Tagged<T> { pub tag: Tag, pub item: T, }
Expand description
A wrapper type that attaches a Tag to a value
Fields
tag: Tag
item: T
Implementations
impl Tagged<String>
[src]
impl Tagged<String>
[src]pub fn borrow_spanned(&self) -> Spanned<&str>
[src]
pub fn borrow_spanned(&self) -> Spanned<&str>
[src]Allows borrowing the contained string slice as a spanned value
pub fn borrow_tagged(&self) -> Tagged<&str>
[src]
pub fn borrow_tagged(&self) -> Tagged<&str>
[src]Allows borrowing the contained string slice as a tagged value
impl<T> Tagged<T>
[src]
impl<T> Tagged<T>
[src]pub fn map<U>(self, input: impl FnOnce(T) -> U) -> Tagged<U>
[src]
pub fn map_anchored(self, anchor: &Option<AnchorLocation>) -> Tagged<T>
[src]
pub fn transpose(&self) -> Tagged<&T>
[src]
pub fn anchor(&self) -> Option<AnchorLocation>
[src]
pub fn anchor(&self) -> Option<AnchorLocation>
[src]Returns the AnchorLocation
of the Tag
if there is one.
pub fn anchor_name(&self) -> Option<String>
[src]
pub fn anchor_name(&self) -> Option<String>
[src]Returns the underlying AnchorLocation
variant type as a string.
pub fn into_parts(self) -> (T, Tag)
[src]
pub fn into_parts(self) -> (T, Tag)
[src]Returns a tuple of the Tagged
item and Tag
.
Trait Implementations
impl<'de, T> Deserialize<'de> for Tagged<T> where
T: Deserialize<'de>,
[src]
impl<'de, T> Deserialize<'de> for Tagged<T> where
T: Deserialize<'de>,
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<T: Ord> Ord for Tagged<T>
[src]
impl<T: Ord> Ord for Tagged<T>
[src]impl<T: PartialOrd> PartialOrd<Tagged<T>> for Tagged<T>
[src]
impl<T: PartialOrd> PartialOrd<Tagged<T>> for Tagged<T>
[src]fn partial_cmp(&self, other: &Tagged<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Tagged<T>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Eq> Eq for Tagged<T>
[src]
impl<T> StructuralEq for Tagged<T>
[src]
impl<T> StructuralPartialEq for Tagged<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Tagged<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Tagged<T> where
T: Send,
T: Send,
impl<T> Sync for Tagged<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Tagged<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Tagged<T> where
T: UnwindSafe,
T: UnwindSafe,
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<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,