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 const fn new_unchecked(name: &'a str) -> ReceiveName<'a>
pub const fn new_unchecked(name: &'a str) -> ReceiveName<'a>
Create a new ReceiveName without checking the format. Expected format: “<contract_name>.<func_name>”.
Sourcepub const fn get_chain_name(self) -> &'a str
pub const 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 duplicate 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§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> StructuralPartialEq for ReceiveName<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReceiveName<'a>
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