Skip to main content

Punct

Enum Punct 

Source
pub enum Punct {
Show 23 variants And(And), Or(Or), Not(Not), Tilde(Tilde), Plus(Plus), Minus(Minus), Underscore(Underscore), Star(Star), Slash(Slash), Percent(Percent), Caret(Caret), Eq(Eq), Lt(Lt), Gt(Gt), At(At), Dot(Dot), Comma(Comma), Semi(Semi), Colon(Colon), Pound(Pound), Dollar(Dollar), Question(Question), Quote(Quote),
}
Expand description

A Rust punctuation token.

Variants§

§

And(And)

§

Or(Or)

§

Not(Not)

§

Tilde(Tilde)

§

Plus(Plus)

§

Minus(Minus)

§

Underscore(Underscore)

§

Star(Star)

§

Slash(Slash)

§

Percent(Percent)

§

Caret(Caret)

§

Eq(Eq)

§

Lt(Lt)

§

Gt(Gt)

§

At(At)

§

Dot(Dot)

§

Comma(Comma)

§

Semi(Semi)

§

Colon(Colon)

§

Pound(Pound)

§

Dollar(Dollar)

§

Question(Question)

§

Quote(Quote)

Implementations§

Source§

impl Punct

Source

pub fn as_str(&self) -> &'static str

Source

pub fn span(&self) -> Span

Source

pub fn set_span(&mut self, span: Span)

Source

pub fn spacing(&self) -> Spacing

Source

pub fn set_spacing(&mut self, spacing: Spacing)

Source

pub fn to_token_tree(&self) -> TokenTree

Source

pub fn into_token_tree(self) -> TokenTree

Trait Implementations§

Source§

impl Clone for Punct

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Punct

Source§

impl Debug for Punct

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Punct

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Punct

Source§

impl From<And> for Punct

Source§

fn from(value: And) -> Self

Converts to this type from the input type.
Source§

impl From<At> for Punct

Source§

fn from(value: At) -> Self

Converts to this type from the input type.
Source§

impl From<Caret> for Punct

Source§

fn from(value: Caret) -> Self

Converts to this type from the input type.
Source§

impl From<Colon> for Punct

Source§

fn from(value: Colon) -> Self

Converts to this type from the input type.
Source§

impl From<Comma> for Punct

Source§

fn from(value: Comma) -> Self

Converts to this type from the input type.
Source§

impl From<Dollar> for Punct

Source§

fn from(value: Dollar) -> Self

Converts to this type from the input type.
Source§

impl From<Dot> for Punct

Source§

fn from(value: Dot) -> Self

Converts to this type from the input type.
Source§

impl From<Eq> for Punct

Source§

fn from(value: Eq) -> Self

Converts to this type from the input type.
Source§

impl From<Gt> for Punct

Source§

fn from(value: Gt) -> Self

Converts to this type from the input type.
Source§

impl From<Lt> for Punct

Source§

fn from(value: Lt) -> Self

Converts to this type from the input type.
Source§

impl From<Minus> for Punct

Source§

fn from(value: Minus) -> Self

Converts to this type from the input type.
Source§

impl From<Not> for Punct

Source§

fn from(value: Not) -> Self

Converts to this type from the input type.
Source§

impl From<Or> for Punct

Source§

fn from(value: Or) -> Self

Converts to this type from the input type.
Source§

impl From<Percent> for Punct

Source§

fn from(value: Percent) -> Self

Converts to this type from the input type.
Source§

impl From<Plus> for Punct

Source§

fn from(value: Plus) -> Self

Converts to this type from the input type.
Source§

impl From<Pound> for Punct

Source§

fn from(value: Pound) -> Self

Converts to this type from the input type.
Source§

impl From<Punct> for TokenTree

Source§

fn from(value: Punct) -> Self

Converts to this type from the input type.
Source§

impl From<Question> for Punct

Source§

fn from(value: Question) -> Self

Converts to this type from the input type.
Source§

impl From<Quote> for Punct

Source§

fn from(value: Quote) -> Self

Converts to this type from the input type.
Source§

impl From<Semi> for Punct

Source§

fn from(value: Semi) -> Self

Converts to this type from the input type.
Source§

impl From<Slash> for Punct

Source§

fn from(value: Slash) -> Self

Converts to this type from the input type.
Source§

impl From<Star> for Punct

Source§

fn from(value: Star) -> Self

Converts to this type from the input type.
Source§

impl From<Tilde> for Punct

Source§

fn from(value: Tilde) -> Self

Converts to this type from the input type.
Source§

impl From<Underscore> for Punct

Source§

fn from(value: Underscore) -> Self

Converts to this type from the input type.
Source§

impl Hash for Punct

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Punct

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Scan for Punct

Source§

fn scan(cursor: Cursor<'_>) -> Result<(Cursor<'_>, Self), LexError>

Source§

impl Spanner for Punct

Source§

fn span(&self) -> Span

Source§

impl StructuralPartialEq for Punct

Source§

impl ToTokens for Punct

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Auto Trait Implementations§

§

impl !Send for Punct

§

impl !Sync for Punct

§

impl Freeze for Punct

§

impl RefUnwindSafe for Punct

§

impl Unpin for Punct

§

impl UnsafeUnpin for Punct

§

impl UnwindSafe for Punct

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<X> ToTokenStream for X
where X: ToTokens + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.