pub struct SignedPayload { /* private fields */ }Expand description
Stores a signed payload ed25519 signer.
The inner payload must be 1..=64 bytes. Empty payloads are not valid per stellar-core (SetOptionsOpFrame rejects them with SET_OPTIONS_BAD_SIGNER).
Implementations§
Source§impl SignedPayload
impl SignedPayload
pub const MAX_ENCODED_LEN: usize
Sourcepub fn new(ed25519: [u8; 32], payload: &[u8]) -> Result<Self, DecodeError>
pub fn new(ed25519: [u8; 32], payload: &[u8]) -> Result<Self, DecodeError>
Constructs a SignedPayload from an ed25519 public key and inner payload.
§Errors
If the inner payload is empty or larger than 64 bytes.
Sourcepub fn to_string(&self) -> String<{ Self::MAX_ENCODED_LEN }>
pub fn to_string(&self) -> String<{ Self::MAX_ENCODED_LEN }>
Returns the strkey string for the signed payload signer.
Sourcepub fn from_payload(payload: &[u8]) -> Result<Self, DecodeError>
pub fn from_payload(payload: &[u8]) -> Result<Self, DecodeError>
Decodes a signed payload from raw bytes.
§Errors
If the inner payload is empty or larger than 64 bytes, if the overall layout is malformed (wrong total length, truncated fields), or if the trailing padding bytes are not all zero.
pub fn from_string(s: &str) -> Result<Self, DecodeError>
pub fn from_slice(s: &[u8]) -> Result<Self, DecodeError>
Trait Implementations§
Source§impl Clone for SignedPayload
impl Clone for SignedPayload
Source§fn clone(&self) -> SignedPayload
fn clone(&self) -> SignedPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SignedPayload
impl Debug for SignedPayload
Source§impl Display for SignedPayload
impl Display for SignedPayload
impl Eq for SignedPayload
Source§impl FromStr for SignedPayload
impl FromStr for SignedPayload
Source§impl Hash for SignedPayload
impl Hash for SignedPayload
Source§impl Ord for SignedPayload
impl Ord for SignedPayload
Source§fn cmp(&self, other: &SignedPayload) -> Ordering
fn cmp(&self, other: &SignedPayload) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SignedPayload
impl PartialEq for SignedPayload
Source§fn eq(&self, other: &SignedPayload) -> bool
fn eq(&self, other: &SignedPayload) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SignedPayload
impl PartialOrd for SignedPayload
impl StructuralPartialEq for SignedPayload
Auto Trait Implementations§
impl Freeze for SignedPayload
impl RefUnwindSafe for SignedPayload
impl Send for SignedPayload
impl Sync for SignedPayload
impl Unpin for SignedPayload
impl UnsafeUnpin for SignedPayload
impl UnwindSafe for SignedPayload
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