Struct concordium_std::ReceiveName
source · pub struct ReceiveName<'a>(/* private fields */);Expand description
A receive name. Expected format: “<contract_name>.<func_name>”.
Implementations§
source§impl<'a> ReceiveName<'a>
impl<'a> ReceiveName<'a>
sourcepub fn new(name: &'a str) -> Result<ReceiveName<'a>, NewReceiveNameError>
pub fn new(name: &'a str) -> Result<ReceiveName<'a>, NewReceiveNameError>
Create a new ReceiveName and check the format. Expected format: “<contract_name>.<func_name>”.
sourcepub fn new_unchecked(name: &'a str) -> ReceiveName<'a>
pub fn new_unchecked(name: &'a str) -> ReceiveName<'a>
Create a new ReceiveName without checking the format. Expected format: “<contract_name>.<func_name>”.
sourcepub fn get_chain_name(self) -> &'a str
pub fn get_chain_name(self) -> &'a str
Get receive name used on chain: “<contract_name>.<func_name>”.
sourcepub fn to_owned(self) -> OwnedReceiveName
pub fn to_owned(self) -> OwnedReceiveName
Convert a ReceiveName to its owned counterpart. This is an expensive
operation that requires memory allocation.
sourcepub fn contract_name(self) -> &'a str
pub fn contract_name(self) -> &'a str
Extract the contract name by splitting at the first dot.
sourcepub fn entrypoint_name(self) -> EntrypointName<'a>
pub fn entrypoint_name(self) -> EntrypointName<'a>
Extract the entrypoint name by splitting at the first dot.
sourcepub fn is_valid_receive_name(name: &str) -> Result<(), NewReceiveNameError>
pub fn is_valid_receive_name(name: &str) -> Result<(), NewReceiveNameError>
Check whether the given string is a valid contract receive function name. This is the case if and only if
- the string is no more than constants::MAX_FUNC_NAME_SIZE bytes
- the string contains a
. - all characters are ascii alphanumeric or punctuation characters.
Trait Implementations§
source§impl<'a> Clone for ReceiveName<'a>
impl<'a> Clone for ReceiveName<'a>
source§fn clone(&self) -> ReceiveName<'a>
fn clone(&self) -> ReceiveName<'a>
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<'a> Debug for ReceiveName<'a>
impl<'a> Debug for ReceiveName<'a>
source§impl<'a> Display for ReceiveName<'a>
impl<'a> Display for ReceiveName<'a>
source§impl<'a> Hash for ReceiveName<'a>
impl<'a> Hash for ReceiveName<'a>
source§impl<'a> PartialEq<&'a str> for ReceiveName<'a>
impl<'a> PartialEq<&'a str> for ReceiveName<'a>
source§impl<'a> PartialEq<str> for ReceiveName<'a>
impl<'a> PartialEq<str> for ReceiveName<'a>
source§impl<'a> PartialEq for ReceiveName<'a>
impl<'a> PartialEq for ReceiveName<'a>
source§fn eq(&self, other: &ReceiveName<'a>) -> bool
fn eq(&self, other: &ReceiveName<'a>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'a> Serial for ReceiveName<'a>
impl<'a> Serial for ReceiveName<'a>
impl<'a> Copy for ReceiveName<'a>
impl<'a> Eq for ReceiveName<'a>
impl<'a> StructuralEq for ReceiveName<'a>
impl<'a> StructuralPartialEq for ReceiveName<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ReceiveName<'a>
impl<'a> Send for ReceiveName<'a>
impl<'a> Sync for ReceiveName<'a>
impl<'a> Unpin for ReceiveName<'a>
impl<'a> UnwindSafe for ReceiveName<'a>
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