pub struct PartialWallet { /* private fields */ }Expand description
The struct represents a partial wallet with essential components for a payment transaction.
A PartialWallet includes a Pointcheval-Sanders signature (sig),
a scalar value (v) representing the wallet’s secret, an optional
SignerIndex (idx) indicating the signer’s index, and an expiration date (expiration_date).
Implementations§
Source§impl PartialWallet
impl PartialWallet
pub fn signature(&self) -> &Signature
pub fn index(&self) -> u64
pub fn expiration_date(&self) -> Scalar
pub fn t_type(&self) -> Scalar
Sourcepub fn to_bytes(&self) -> [u8; 200]
pub fn to_bytes(&self) -> [u8; 200]
Converts the PartialWallet to a fixed-size byte array.
The resulting byte array has a length of 200 bytes and contains serialized
representations of the Signature (sig), scalar value (v),
expiration date (expiration_date), and idx fields of the PartialWallet struct.
§Returns
A fixed-size byte array ([u8; 200]) representing the serialized form of the PartialWallet.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<PartialWallet, CompactEcashError>
pub fn from_bytes(bytes: &[u8]) -> Result<PartialWallet, CompactEcashError>
Convert a byte slice into a PartialWallet instance.
This function performs deserialization on the provided byte slice, which
represent a serialized PartialWallet.
§Arguments
bytes- A reference to the byte slice to be deserialized.
§Returns
A Result containing the deserialized PartialWallet if successful, or a
CompactEcashError indicating the reason for failure.
Trait Implementations§
Source§impl Base58 for PartialWallet
impl Base58 for PartialWallet
Source§impl Bytable for PartialWallet
impl Bytable for PartialWallet
fn to_byte_vec(&self) -> Vec<u8> ⓘ
fn try_from_byte_slice(slice: &[u8]) -> Result<PartialWallet, CompactEcashError>
Source§impl Clone for PartialWallet
impl Clone for PartialWallet
Source§fn clone(&self) -> PartialWallet
fn clone(&self) -> PartialWallet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartialWallet
impl Debug for PartialWallet
Source§impl Drop for PartialWallet
impl Drop for PartialWallet
Source§impl PartialEq for PartialWallet
impl PartialEq for PartialWallet
Source§impl TryFrom<&[u8]> for PartialWallet
impl TryFrom<&[u8]> for PartialWallet
Source§type Error = CompactEcashError
type Error = CompactEcashError
Source§fn try_from(bytes: &[u8]) -> Result<PartialWallet, CompactEcashError>
fn try_from(bytes: &[u8]) -> Result<PartialWallet, CompactEcashError>
Source§impl Zeroize for PartialWallet
impl Zeroize for PartialWallet
impl StructuralPartialEq for PartialWallet
Auto Trait Implementations§
impl Freeze for PartialWallet
impl RefUnwindSafe for PartialWallet
impl Send for PartialWallet
impl Sync for PartialWallet
impl Unpin for PartialWallet
impl UnsafeUnpin for PartialWallet
impl UnwindSafe for PartialWallet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more