pub enum SupportsFeature {
Declaration(Box<Declaration>),
Function(Function),
}
Variants§
Declaration(Box<Declaration>)
Function(Function)
Implementations§
Source§impl SupportsFeature
impl SupportsFeature
Sourcepub const fn is_declaration(&self) -> bool
pub const fn is_declaration(&self) -> bool
Returns true
if self
is of variant Declaration
.
Sourcepub fn as_declaration(&self) -> Option<&Box<Declaration>>
pub fn as_declaration(&self) -> Option<&Box<Declaration>>
Returns Some
if self
is a reference of variant Declaration
, and None
otherwise.
Sourcepub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
pub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
Returns Some
if self
is a mutable reference of variant Declaration
, and None
otherwise.
Sourcepub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
pub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
Unwraps the value, yielding the content of Declaration
.
§Panics
Panics if the value is not Declaration
, with a panic message including the content of self
.
Sourcepub fn declaration(self) -> Option<Box<Declaration>>
pub fn declaration(self) -> Option<Box<Declaration>>
Returns Some
if self
is of variant Declaration
, and None
otherwise.
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,
Trait Implementations§
Source§impl Clone for SupportsFeature
impl Clone for SupportsFeature
Source§fn clone(&self) -> SupportsFeature
fn clone(&self) -> SupportsFeature
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 SupportsFeature
impl Debug for SupportsFeature
Source§impl EqIgnoreSpan for SupportsFeature
impl EqIgnoreSpan for SupportsFeature
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<Box<Declaration>> for SupportsFeature
impl From<Box<Declaration>> for SupportsFeature
Source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
Converts to this type from the input type.
Source§impl From<Function> for SupportsFeature
impl From<Function> for SupportsFeature
Source§impl From<SupportsFeature> for SupportsInParens
impl From<SupportsFeature> for SupportsInParens
Source§fn from(v: SupportsFeature) -> Self
fn from(v: SupportsFeature) -> Self
Converts to this type from the input type.
Source§impl Hash for SupportsFeature
impl Hash for SupportsFeature
Source§impl PartialEq for SupportsFeature
impl PartialEq for SupportsFeature
Source§impl Spanned for SupportsFeature
impl Spanned for SupportsFeature
impl Eq for SupportsFeature
impl StructuralPartialEq for SupportsFeature
Auto Trait Implementations§
impl Freeze for SupportsFeature
impl RefUnwindSafe for SupportsFeature
impl Send for SupportsFeature
impl Sync for SupportsFeature
impl Unpin for SupportsFeature
impl UnwindSafe for SupportsFeature
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