Struct Punct
struct Punct { ... }
A Punct is a single punctuation character like +, - or #.
Multicharacter operators like += are represented as two instances of
Punct with different forms of Spacing returned.
Implementations
impl Punct
fn new(ch: char, spacing: Spacing) -> SelfCreates a new
Punctfrom the given character and spacing.The
chargument must be a valid punctuation character permitted by the language, otherwise the function will panic.The returned
Punctwill have the default span ofSpan::call_site()which can be further configured with theset_spanmethod below.fn as_char(self: &Self) -> charReturns the value of this punctuation character as
char.fn spacing(self: &Self) -> SpacingReturns the spacing of this punctuation character, indicating whether it's immediately followed by another
Punctin the token stream, so they can potentially be combined into a multicharacter operator (Joint), or it's followed by some other token or whitespace (Alone) so the operator has certainly ended.fn span(self: &Self) -> SpanReturns the span for this punctuation character.
fn set_span(self: &mut Self, span: Span)Configure the span for this punctuation character.
impl Clone for Punct
fn clone(self: &Self) -> Punct
impl Debug for Punct
fn fmt(self: &Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl Display for Punct
fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Freeze for Punct
impl RefUnwindSafe for Punct
impl Send for Punct
impl Sync for Punct
impl Unpin for Punct
impl UnwindSafe for Punct
impl<T> Any for Punct
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Punct
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Punct
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Punct
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Punct
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Punct
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Punct
fn to_string(self: &Self) -> String
impl<T, U> Into for Punct
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Punct
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Punct
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>