pub struct WithOuterAttributes<T> {
pub attrs: Vec<OuterAttrOrDocComment>,
pub inner: T,
}Expand description
A type with outer attributes
Fields§
§attrs: Vec<OuterAttrOrDocComment>§inner: TImplementations§
Source§impl<T> WithOuterAttributes<T>
impl<T> WithOuterAttributes<T>
Sourcepub const fn without_attributes(inner: T) -> Self
pub const fn without_attributes(inner: T) -> Self
Creates a new value without any attributes
Sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> WithOuterAttributes<U>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> WithOuterAttributes<U>
Maps the inner type
Trait Implementations§
Source§impl ArenaData for WithOuterAttributes<ItemInner>
impl ArenaData for WithOuterAttributes<ItemInner>
fn with_arena<O>(f: impl FnOnce(&UnsafeCell<Arena<Self>>) -> O) -> O
Source§impl<T: Clone> Clone for WithOuterAttributes<T>
impl<T: Clone> Clone for WithOuterAttributes<T>
Source§fn clone(&self) -> WithOuterAttributes<T>
fn clone(&self) -> WithOuterAttributes<T>
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<T: Debug> Debug for WithOuterAttributes<T>
impl<T: Debug> Debug for WithOuterAttributes<T>
Source§impl<'de, T> Deserialize<'de> for WithOuterAttributes<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for WithOuterAttributes<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<A, T: Format<WhitespaceConfig, A>> Format<WhitespaceConfig, FmtArgs<A>> for WithOuterAttributes<T>
impl<A, T: Format<WhitespaceConfig, A>> Format<WhitespaceConfig, FmtArgs<A>> for WithOuterAttributes<T>
Source§fn format(
&mut self,
ctx: &mut Context<'_>,
prefix_ws: WhitespaceConfig,
args: FmtArgs<A>,
) -> FormatOutput
fn format( &mut self, ctx: &mut Context<'_>, prefix_ws: WhitespaceConfig, args: FmtArgs<A>, ) -> FormatOutput
Formats this type.
Source§impl<T> Formattable for WithOuterAttributes<T>
impl<T> Formattable for WithOuterAttributes<T>
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<T> From<T> for WithOuterAttributes<T>
impl<T> From<T> for WithOuterAttributes<T>
Source§impl From<WithOuterAttributes<ExpressionWithoutBlockInner>> for ExpressionWithoutBlock
impl From<WithOuterAttributes<ExpressionWithoutBlockInner>> for ExpressionWithoutBlock
Source§fn from(value: WithOuterAttributes<ExpressionWithoutBlockInner>) -> Self
fn from(value: WithOuterAttributes<ExpressionWithoutBlockInner>) -> Self
Converts to this type from the input type.
Source§impl<T, R> ParsableRecursive<R> for WithOuterAttributes<T>where
T: ParsableRecursive<R>,
impl<T, R> ParsableRecursive<R> for WithOuterAttributes<T>where
T: ParsableRecursive<R>,
Source§type Base = WithOuterAttributes<<T as ParsableRecursive<R>>::Base>
type Base = WithOuterAttributes<<T as ParsableRecursive<R>>::Base>
Base type
Source§type Infix = <T as ParsableRecursive<R>>::Infix
type Infix = <T as ParsableRecursive<R>>::Infix
The infix of this type
Source§type Prefix = <T as ParsableRecursive<R>>::Prefix
type Prefix = <T as ParsableRecursive<R>>::Prefix
The prefix for this type
Source§type Suffix = <T as ParsableRecursive<R>>::Suffix
type Suffix = <T as ParsableRecursive<R>>::Suffix
The suffix for this type
Source§fn join_suffix(root: R, suffix: Self::Suffix, parser: &mut Parser) -> Self
fn join_suffix(root: R, suffix: Self::Suffix, parser: &mut Parser) -> Self
Creates this type from it’s parts
Source§fn join_prefix(prefix: Self::Prefix, root: R, parser: &mut Parser) -> Self
fn join_prefix(prefix: Self::Prefix, root: R, parser: &mut Parser) -> Self
Creates this type from it’s parts
Source§fn join_infix(lhs: R, infix: Self::Infix, rhs: R, parser: &mut Parser) -> Self
fn join_infix(lhs: R, infix: Self::Infix, rhs: R, parser: &mut Parser) -> Self
Creates this type from it’s parts
Source§impl<T> Parse for WithOuterAttributes<T>
impl<T> Parse for WithOuterAttributes<T>
Source§impl<T: PartialEq> PartialEq for WithOuterAttributes<T>
impl<T: PartialEq> PartialEq for WithOuterAttributes<T>
Source§impl<T> Print for WithOuterAttributes<T>
impl<T> Print for WithOuterAttributes<T>
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<T> Serialize for WithOuterAttributes<T>where
T: Serialize,
impl<T> Serialize for WithOuterAttributes<T>where
T: Serialize,
impl<T: Eq> Eq for WithOuterAttributes<T>
impl<T> StructuralPartialEq for WithOuterAttributes<T>
Auto Trait Implementations§
impl<T> Freeze for WithOuterAttributes<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithOuterAttributes<T>where
T: RefUnwindSafe,
impl<T> !Send for WithOuterAttributes<T>
impl<T> !Sync for WithOuterAttributes<T>
impl<T> Unpin for WithOuterAttributes<T>where
T: Unpin,
impl<T> UnsafeUnpin for WithOuterAttributes<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WithOuterAttributes<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
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