[−][src]Enum stellar_base::memo::Memo
Memo attached to transactions.
Variants
No memo
Text(String)
Text Memo
Id(u64)
Id Memo
Hash Memo
Return Memo
Implementations
impl Memo
[src]
pub fn new_none() -> Memo
[src]
Create new empty memo.
pub fn new_id(id: u64) -> Memo
[src]
Create new id memo.
pub fn new_text<S: Into<String>>(text: S) -> Result<Memo>
[src]
Create new text memo. text
must be shorter than 28 bytes.
pub fn new_hash(hash: &[u8]) -> Result<Memo>
[src]
Create new hash memo.
pub fn new_return(ret: &[u8]) -> Result<Memo>
[src]
Creates new return memo.
pub fn is_none(&self) -> bool
[src]
Returns true if memo is None. Returns false otherwise.
pub fn as_id(&self) -> Option<&u64>
[src]
If the memo is an Id, returns its value. Returns None otherwise.
pub fn as_id_mut(&mut self) -> Option<&mut u64>
[src]
If the memo is an Id, returns its mutable value. Returns None otherwise.
pub fn is_id(&self) -> bool
[src]
Returns true if memo is Id. Returns false otherwise.
pub fn as_text(&self) -> Option<&str>
[src]
If the memo is a Text, returns its value. Returns None otherwise.
pub fn as_text_mut(&mut self) -> Option<&mut str>
[src]
If the memo is a Text, returns its value. Returns None otherwise.
pub fn is_text(&self) -> bool
[src]
Returns true if memo is Text. Returns false otherwise.
pub fn as_hash(&self) -> Option<&[u8; 32]>
[src]
If the memo is a Hash, returns its value. Returns None otherwise.
pub fn as_hash_mut(&mut self) -> Option<&mut [u8; 32]>
[src]
If the memo is a Hash, returns its mutable value. Returns None otherwise.
pub fn is_hash(&self) -> bool
[src]
Returns true if memo is a Hash.
pub fn as_return(&self) -> Option<&[u8; 32]>
[src]
If the memo is a Return, returns its value. Returns None otherwise.
pub fn as_return_mut(&mut self) -> Option<&mut [u8; 32]>
[src]
If the memo is a Return, returns its mutable value. Returns None otherwise.
pub fn is_return(&self) -> bool
[src]
Returns true if memo is a Return.
pub fn to_xdr(&self) -> Result<Memo>
[src]
Returns the memo xdr object.
pub fn from_xdr(x: &Memo) -> Result<Memo>
[src]
Creates a new memo from the xdr object.
Trait Implementations
impl Clone for Memo
[src]
impl Debug for Memo
[src]
impl Default for Memo
[src]
impl Eq for Memo
[src]
impl PartialEq<Memo> for Memo
[src]
impl StructuralEq for Memo
[src]
impl StructuralPartialEq for Memo
[src]
impl XDRDeserialize for Memo
[src]
fn from_xdr_bytes(buffer: &[u8]) -> Result<(Self, u64)>
[src]
fn from_xdr_base64(encoded: &str) -> Result<Self>
[src]
impl XDRSerialize for Memo
[src]
Auto Trait Implementations
impl RefUnwindSafe for Memo
impl Send for Memo
impl Sync for Memo
impl Unpin for Memo
impl UnwindSafe for Memo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,