[][src]Enum stellar_base::memo::Memo

pub enum Memo {
    None,
    Text(String),
    Id(u64),
    Hash([u8; 32]),
    Return([u8; 32]),
}

Memo attached to transactions.

Variants

None

No memo

Text(String)

Text Memo

Id(u64)

Id Memo

Hash([u8; 32])

Hash Memo

Return([u8; 32])

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]

impl XDRSerialize for Memo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.