pub struct StakeDistribution(/* private fields */);Implementations§
Source§impl StakeDistribution
impl StakeDistribution
Sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes.
- This type does NOT support fine-tuned encoding options so this may or may not be
- canonical CBOR and may or may not preserve round-trip encodings.
Sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<StakeDistribution, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<StakeDistribution, JsError>
- Create this type from CBOR bytes
Sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type does NOT support fine-tuned encoding options so this may or may not be
- canonical CBOR and may or may not preserve round-trip encodings.
Sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<StakeDistribution, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<StakeDistribution, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
Source§impl StakeDistribution
impl StakeDistribution
pub fn new_single_key(stakeholder_id: &StakeholderId) -> Self
pub fn new_bootstrap_era() -> Self
pub fn kind(&self) -> StakeDistributionKind
pub fn as_single_key(&self) -> Option<StakeholderId>
Trait Implementations§
Source§impl AsRef<StakeDistribution> for StakeDistribution
impl AsRef<StakeDistribution> for StakeDistribution
Source§fn as_ref(&self) -> &StakeDistribution
fn as_ref(&self) -> &StakeDistribution
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for StakeDistribution
impl Clone for StakeDistribution
Source§fn clone(&self) -> StakeDistribution
fn clone(&self) -> StakeDistribution
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 Debug for StakeDistribution
impl Debug for StakeDistribution
Source§impl From<StakeDistribution> for JsValue
impl From<StakeDistribution> for JsValue
Source§fn from(value: StakeDistribution) -> Self
fn from(value: StakeDistribution) -> Self
Converts to this type from the input type.
Source§impl From<StakeDistribution> for StakeDistribution
impl From<StakeDistribution> for StakeDistribution
Source§fn from(native: StakeDistribution) -> Self
fn from(native: StakeDistribution) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for StakeDistribution
impl FromWasmAbi for StakeDistribution
Source§impl Into<StakeDistribution> for StakeDistribution
impl Into<StakeDistribution> for StakeDistribution
Source§fn into(self) -> StakeDistribution
fn into(self) -> StakeDistribution
Converts this type into the (usually inferred) input type.
Source§impl IntoWasmAbi for StakeDistribution
impl IntoWasmAbi for StakeDistribution
Source§impl RefFromWasmAbi for StakeDistribution
impl RefFromWasmAbi for StakeDistribution
Source§type Anchor = RcRef<StakeDistribution>
type Anchor = RcRef<StakeDistribution>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl TryFromJsValue for StakeDistribution
impl TryFromJsValue for StakeDistribution
Source§impl VectorFromWasmAbi for StakeDistribution
impl VectorFromWasmAbi for StakeDistribution
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[StakeDistribution]>
Source§impl VectorIntoJsValue for StakeDistribution
impl VectorIntoJsValue for StakeDistribution
fn vector_into_jsvalue(vector: Box<[StakeDistribution]>) -> JsValue
Source§impl VectorIntoWasmAbi for StakeDistribution
impl VectorIntoWasmAbi for StakeDistribution
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[StakeDistribution]>) -> Self::Abi
Source§impl WasmDescribeVector for StakeDistribution
impl WasmDescribeVector for StakeDistribution
impl SupportsConstructor for StakeDistribution
impl SupportsInstanceProperty for StakeDistribution
impl SupportsStaticProperty for StakeDistribution
Auto Trait Implementations§
impl Freeze for StakeDistribution
impl RefUnwindSafe for StakeDistribution
impl Send for StakeDistribution
impl Sync for StakeDistribution
impl Unpin for StakeDistribution
impl UnwindSafe for StakeDistribution
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.