pub enum GeneralEnclosed {
Function(Function),
SimpleBlock(SimpleBlock),
}
Variants§
Function(Function)
SimpleBlock(SimpleBlock)
Implementations§
Source§impl GeneralEnclosed
impl GeneralEnclosed
Sourcepub const fn is_function(&self) -> bool
pub const fn is_function(&self) -> bool
Returns true
if self
is of variant Function
.
Sourcepub fn as_function(&self) -> Option<&Function>
pub fn as_function(&self) -> Option<&Function>
Returns Some
if self
is a reference of variant Function
, and None
otherwise.
Sourcepub fn as_mut_function(&mut self) -> Option<&mut Function>
pub fn as_mut_function(&mut self) -> Option<&mut Function>
Returns Some
if self
is a mutable reference of variant Function
, and None
otherwise.
Sourcepub fn expect_function(self) -> Functionwhere
Self: Debug,
pub fn expect_function(self) -> Functionwhere
Self: Debug,
Sourcepub fn function(self) -> Option<Function>
pub fn function(self) -> Option<Function>
Returns Some
if self
is of variant Function
, and None
otherwise.
Sourcepub const fn is_simple_block(&self) -> bool
pub const fn is_simple_block(&self) -> bool
Returns true
if self
is of variant SimpleBlock
.
Sourcepub fn as_simple_block(&self) -> Option<&SimpleBlock>
pub fn as_simple_block(&self) -> Option<&SimpleBlock>
Returns Some
if self
is a reference of variant SimpleBlock
, and None
otherwise.
Sourcepub fn as_mut_simple_block(&mut self) -> Option<&mut SimpleBlock>
pub fn as_mut_simple_block(&mut self) -> Option<&mut SimpleBlock>
Returns Some
if self
is a mutable reference of variant SimpleBlock
, and None
otherwise.
Sourcepub fn expect_simple_block(self) -> SimpleBlockwhere
Self: Debug,
pub fn expect_simple_block(self) -> SimpleBlockwhere
Self: Debug,
Unwraps the value, yielding the content of SimpleBlock
.
§Panics
Panics if the value is not SimpleBlock
, with a panic message including the content of self
.
Sourcepub fn simple_block(self) -> Option<SimpleBlock>
pub fn simple_block(self) -> Option<SimpleBlock>
Returns Some
if self
is of variant SimpleBlock
, and None
otherwise.
Trait Implementations§
Source§impl Clone for GeneralEnclosed
impl Clone for GeneralEnclosed
Source§fn clone(&self) -> GeneralEnclosed
fn clone(&self) -> GeneralEnclosed
Returns a copy 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 GeneralEnclosed
impl Debug for GeneralEnclosed
Source§impl EqIgnoreSpan for GeneralEnclosed
impl EqIgnoreSpan for GeneralEnclosed
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<Function> for GeneralEnclosed
impl From<Function> for GeneralEnclosed
Source§impl From<GeneralEnclosed> for MediaInParens
impl From<GeneralEnclosed> for MediaInParens
Source§fn from(v: GeneralEnclosed) -> Self
fn from(v: GeneralEnclosed) -> Self
Converts to this type from the input type.
Source§impl From<GeneralEnclosed> for QueryInParens
impl From<GeneralEnclosed> for QueryInParens
Source§fn from(v: GeneralEnclosed) -> Self
fn from(v: GeneralEnclosed) -> Self
Converts to this type from the input type.
Source§impl From<GeneralEnclosed> for SupportsInParens
impl From<GeneralEnclosed> for SupportsInParens
Source§fn from(v: GeneralEnclosed) -> Self
fn from(v: GeneralEnclosed) -> Self
Converts to this type from the input type.
Source§impl From<SimpleBlock> for GeneralEnclosed
impl From<SimpleBlock> for GeneralEnclosed
Source§fn from(v: SimpleBlock) -> Self
fn from(v: SimpleBlock) -> Self
Converts to this type from the input type.
Source§impl Hash for GeneralEnclosed
impl Hash for GeneralEnclosed
Source§impl PartialEq for GeneralEnclosed
impl PartialEq for GeneralEnclosed
Source§impl Spanned for GeneralEnclosed
impl Spanned for GeneralEnclosed
impl Eq for GeneralEnclosed
impl StructuralPartialEq for GeneralEnclosed
Auto Trait Implementations§
impl Freeze for GeneralEnclosed
impl RefUnwindSafe for GeneralEnclosed
impl Send for GeneralEnclosed
impl Sync for GeneralEnclosed
impl Unpin for GeneralEnclosed
impl UnwindSafe for GeneralEnclosed
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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