pub struct Parens<T> {
pub opening_token: AttachedToken,
pub content: T,
pub closing_token: AttachedToken,
}Expand description
A item T enclosed in a pair of parentheses
Fields§
§opening_token: AttachedTokenthe opening parenthesis token, i.e. (
content: Tcontent enclosed in parentheses
closing_token: AttachedTokenthe closing parenthesis token, i.e. )
Implementations§
Source§impl<T> Parens<T>
impl<T> Parens<T>
Sourcepub fn with_empty_span(content: T) -> Self
pub fn with_empty_span(content: T) -> Self
Constructor wrapping content into Parens with an empty span;
useful for testing purposes.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Parens<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Parens<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Ord> Ord for Parens<T>
impl<T: Ord> Ord for Parens<T>
1.21.0 (const: unstable) · 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<T: PartialOrd> PartialOrd for Parens<T>
impl<T: PartialOrd> PartialOrd for Parens<T>
Source§impl<T: VisitMut> VisitMut for Parens<T>
impl<T: VisitMut> VisitMut for Parens<T>
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
Mutably visit this node with the provided
VisitorMut. Read moreimpl<T: Eq> Eq for Parens<T>
impl<T> StructuralPartialEq for Parens<T>
Auto Trait Implementations§
impl<T> Freeze for Parens<T>where
T: Freeze,
impl<T> RefUnwindSafe for Parens<T>where
T: RefUnwindSafe,
impl<T> Send for Parens<T>where
T: Send,
impl<T> Sync for Parens<T>where
T: Sync,
impl<T> Unpin for Parens<T>where
T: Unpin,
impl<T> UnsafeUnpin for Parens<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Parens<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