Enum bc_envelope::extension::expression::Function
source · pub enum Function {
Known(u64, Option<FunctionName>),
Named(FunctionName),
}Expand description
A declared function.
Variants§
Implementations§
source§impl Function
impl Function
sourcepub fn new_known(value: u64, name: Option<String>) -> Self
pub fn new_known(value: u64, name: Option<String>) -> Self
Creates a new function with a value and an optional name.
sourcepub fn new_named(name: &str) -> Self
pub fn new_named(name: &str) -> Self
Creates a new function with a name. This call cannot be used to declare a function at compile-time.
sourcepub const fn new_with_static_name(value: u64, name: &'static str) -> Self
pub const fn new_with_static_name(value: u64, name: &'static str) -> Self
Creates a new function with a value and a static name. This call can be used to declare a function at compile-time.
sourcepub const fn new_static_named(name: &'static str) -> Self
pub const fn new_static_named(name: &'static str) -> Self
Creates a new function with a static name. This call can be used to declare a function at compile-time.
sourcepub fn named_name(&self) -> Option<String>
pub fn named_name(&self) -> Option<String>
Returns the name of the named function, if any.
Trait Implementations§
source§impl CBORDecodable for Function
impl CBORDecodable for Function
source§impl CBOREncodable for Function
impl CBOREncodable for Function
source§impl CBORTagged for Function
impl CBORTagged for Function
source§impl CBORTaggedDecodable for Function
impl CBORTaggedDecodable for Function
source§fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for Function
impl CBORTaggedEncodable for Function
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl PartialEq for Function
impl PartialEq for Function
impl Eq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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