Enum brane_ast::func_id::FunctionId
source · pub enum FunctionId {
Main,
Func(usize),
}
Expand description
Enum that can be used for function identifiers, to specially handle main
.
Variants§
Implementations§
source§impl FunctionId
impl FunctionId
sourcepub const fn main() -> Self
pub const fn main() -> Self
Constructor for the FunctionId that initializes it as a FunctionId::Main
.
§Returns
A new FunctionId
instance.
sourcepub fn func(id: impl AsPrimitive<usize>) -> Self
pub fn func(id: impl AsPrimitive<usize>) -> Self
Constructor for the FunctionId that initializes it as a FunctionId::Func
.
§Arguments
id
: The identifier of the function to point to.
§Returns
A new FunctionId
instance.
sourcepub const fn is_main(&self) -> bool
pub const fn is_main(&self) -> bool
Returns if this FunctionId is a FunctionId::Main
.
§Returns
True if it is, or false if it’s a FunctionId::Func
.
sourcepub const fn is_func(&self) -> bool
pub const fn is_func(&self) -> bool
Returns if this FunctionId is a FunctionId::Func
.
§Returns
True if it is, or false if it’s a FunctionId::Main
.
Trait Implementations§
source§impl Clone for FunctionId
impl Clone for FunctionId
source§fn clone(&self) -> FunctionId
fn clone(&self) -> FunctionId
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 FunctionId
impl Debug for FunctionId
source§impl<'de> Deserialize<'de> for FunctionId
impl<'de> Deserialize<'de> for FunctionId
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 Display for FunctionId
impl Display for FunctionId
source§impl EnumDebug for FunctionId
impl EnumDebug for FunctionId
source§fn type_name() -> &'static str
fn type_name() -> &'static str
Returns the static name of the type used for EnumDebug-printing. Read more
source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
Returns all variants in the trait as a list of names. Read more
source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Returns the static name of the variant. Read more
source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
Returns a formatter for this enum that writes its variant name. Read more
source§impl From<&FunctionId> for FunctionId
impl From<&FunctionId> for FunctionId
source§impl From<&mut FunctionId> for FunctionId
impl From<&mut FunctionId> for FunctionId
source§impl From<usize> for FunctionId
impl From<usize> for FunctionId
source§impl FromStr for FunctionId
impl FromStr for FunctionId
source§impl Hash for FunctionId
impl Hash for FunctionId
source§impl PartialEq for FunctionId
impl PartialEq for FunctionId
source§impl Serialize for FunctionId
impl Serialize for FunctionId
impl Copy for FunctionId
impl Eq for FunctionId
impl StructuralPartialEq for FunctionId
Auto Trait Implementations§
impl Freeze for FunctionId
impl RefUnwindSafe for FunctionId
impl Send for FunctionId
impl Sync for FunctionId
impl Unpin for FunctionId
impl UnwindSafe for FunctionId
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request