pub enum SimplePathSegment {
Super(Super),
SelfLower(SelfLower),
Crate(Crate),
DollarCrate(DollarCrate),
Ident(Identifier),
}Expand description
SimplePathSegment
Variants§
Implementations§
Source§impl SimplePathSegment
impl SimplePathSegment
pub fn try_as_super(self) -> Option<Super>
pub const fn try_as_super_ref(&self) -> Option<&Super>
pub fn try_as_super_mut(&mut self) -> Option<&mut Super>
pub fn try_as_self_lower(self) -> Option<SelfLower>
pub const fn try_as_self_lower_ref(&self) -> Option<&SelfLower>
pub fn try_as_self_lower_mut(&mut self) -> Option<&mut SelfLower>
pub fn try_as_crate(self) -> Option<Crate>
pub const fn try_as_crate_ref(&self) -> Option<&Crate>
pub fn try_as_crate_mut(&mut self) -> Option<&mut Crate>
pub fn try_as_dollar_crate(self) -> Option<DollarCrate>
pub const fn try_as_dollar_crate_ref(&self) -> Option<&DollarCrate>
pub fn try_as_dollar_crate_mut(&mut self) -> Option<&mut DollarCrate>
pub fn try_as_ident(self) -> Option<Identifier>
pub const fn try_as_ident_ref(&self) -> Option<&Identifier>
pub fn try_as_ident_mut(&mut self) -> Option<&mut Identifier>
Trait Implementations§
Source§impl Clone for SimplePathSegment
impl Clone for SimplePathSegment
Source§fn clone(&self) -> SimplePathSegment
fn clone(&self) -> SimplePathSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimplePathSegment
impl Debug for SimplePathSegment
Source§impl<'de> Deserialize<'de> for SimplePathSegment
impl<'de> Deserialize<'de> for SimplePathSegment
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 Format<WhitespaceConfig, ()> for SimplePathSegment
impl Format<WhitespaceConfig, ()> for SimplePathSegment
Source§fn format(
&mut self,
ctx: &mut Context<'_>,
prefix_ws: WhitespaceConfig,
args: (),
) -> FormatOutput
fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, args: (), ) -> FormatOutput
Formats this type.
Source§impl Formattable for SimplePathSegment
impl Formattable for SimplePathSegment
Source§fn with_prefix_ws<WITH_PREFIX_WS_O>(
&mut self,
ctx: &mut Context<'_>,
f: &mut impl FnMut(&mut Whitespace, &mut Context<'_>) -> WITH_PREFIX_WS_O,
) -> Result<WITH_PREFIX_WS_O, ControlFlow<()>>
fn with_prefix_ws<WITH_PREFIX_WS_O>( &mut self, ctx: &mut Context<'_>, f: &mut impl FnMut(&mut Whitespace, &mut Context<'_>) -> WITH_PREFIX_WS_O, ) -> Result<WITH_PREFIX_WS_O, ControlFlow<()>>
Accesses the prefix whitespace of this type. Read more
Source§fn with_strings<WITH_STRINGS_O>(
&mut self,
ctx: &mut Context<'_>,
exclude_prefix_ws: bool,
f: &mut impl FnMut(&mut AstStr, &mut Context<'_>) -> ControlFlow<WITH_STRINGS_O>,
) -> ControlFlow<WITH_STRINGS_O, bool>
fn with_strings<WITH_STRINGS_O>( &mut self, ctx: &mut Context<'_>, exclude_prefix_ws: bool, f: &mut impl FnMut(&mut AstStr, &mut Context<'_>) -> ControlFlow<WITH_STRINGS_O>, ) -> ControlFlow<WITH_STRINGS_O, bool>
Iterates over all strings in this type. Read more
Source§fn format_output(&mut self, ctx: &mut Context<'_>) -> FormatOutput
fn format_output(&mut self, ctx: &mut Context<'_>) -> FormatOutput
Returns the formatting output for this type, without formatting it.
Source§fn prefix_ws_is_pure(&mut self, ctx: &mut Context<'_>) -> Option<bool>
fn prefix_ws_is_pure(&mut self, ctx: &mut Context<'_>) -> Option<bool>
Returns if the prefix whitespace is pure.
Source§fn prefix_ws_join_prefix(
&mut self,
ctx: &mut Context<'_>,
ws: Whitespace,
) -> Result<(), Whitespace>
fn prefix_ws_join_prefix( &mut self, ctx: &mut Context<'_>, ws: Whitespace, ) -> Result<(), Whitespace>
Joins a string as a prefix onto the prefix whitespace of this type.
Source§impl Parse for SimplePathSegment
impl Parse for SimplePathSegment
Source§impl PartialEq for SimplePathSegment
impl PartialEq for SimplePathSegment
Source§impl Print for SimplePathSegment
impl Print for SimplePathSegment
Source§fn print_non_ws(&self, f: &mut PrintFmt)
fn print_non_ws(&self, f: &mut PrintFmt)
Prints this type onto a writer excluding whitespace Read more
Source§impl Serialize for SimplePathSegment
impl Serialize for SimplePathSegment
impl Eq for SimplePathSegment
impl StructuralPartialEq for SimplePathSegment
Auto Trait Implementations§
impl Freeze for SimplePathSegment
impl RefUnwindSafe for SimplePathSegment
impl !Send for SimplePathSegment
impl !Sync for SimplePathSegment
impl Unpin for SimplePathSegment
impl UnsafeUnpin for SimplePathSegment
impl UnwindSafe for SimplePathSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R, T> FromRecursiveRoot<R> for Twhere
T: From<R>,
impl<R, T> FromRecursiveRoot<R> for Twhere
T: From<R>,
fn from_recursive_root(root: R, _parser: &mut Parser) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more