pub struct BasicOutput { /* private fields */ }block only.Expand description
Describes a basic output with optional features.
Implementations§
Source§impl BasicOutput
impl BasicOutput
pub fn try_from_dto( value: &BasicOutputDto, token_supply: u64, ) -> Result<Self, DtoError>
dto only.pub fn try_from_dto_unverified(value: &BasicOutputDto) -> Result<Self, DtoError>
dto only.pub fn try_from_dtos( amount: OutputBuilderAmountDto, native_tokens: Option<Vec<NativeTokenDto>>, unlock_conditions: Vec<UnlockConditionDto>, features: Option<Vec<FeatureDto>>, token_supply: u64, ) -> Result<Self, DtoError>
dto only.Source§impl BasicOutput
impl BasicOutput
Sourcepub const KIND: u8 = 3
pub const KIND: u8 = 3
The Output kind of an BasicOutput.
Sourcepub const ALLOWED_FEATURES: FeatureFlags
pub const ALLOWED_FEATURES: FeatureFlags
The set of allowed Features for an BasicOutput.
Sourcepub fn new_with_amount(amount: u64, token_supply: u64) -> Result<Self, Error>
pub fn new_with_amount(amount: u64, token_supply: u64) -> Result<Self, Error>
Creates a new BasicOutput with a provided amount.
Sourcepub fn new_with_minimum_storage_deposit(
rent_structure: RentStructure,
token_supply: u64,
) -> Result<Self, Error>
pub fn new_with_minimum_storage_deposit( rent_structure: RentStructure, token_supply: u64, ) -> Result<Self, Error>
Creates a new BasicOutput with a provided rent structure.
The amount will be set to the minimum storage deposit.
Sourcepub fn build_with_amount(amount: u64) -> Result<BasicOutputBuilder, Error>
pub fn build_with_amount(amount: u64) -> Result<BasicOutputBuilder, Error>
Creates a new BasicOutputBuilder with a provided amount.
Sourcepub fn build_with_minimum_storage_deposit(
rent_structure: RentStructure,
) -> Result<BasicOutputBuilder, Error>
pub fn build_with_minimum_storage_deposit( rent_structure: RentStructure, ) -> Result<BasicOutputBuilder, Error>
Creates a new BasicOutputBuilder with a provided rent structure.
The amount will be set to the minimum storage deposit.
Sourcepub fn native_tokens(&self) -> &NativeTokens
pub fn native_tokens(&self) -> &NativeTokens
Sourcepub fn unlock_conditions(&self) -> &UnlockConditions
pub fn unlock_conditions(&self) -> &UnlockConditions
Sourcepub fn unlock(
&self,
_output_id: &OutputId,
unlock: &Unlock,
inputs: &[(OutputId, &Output)],
context: &mut ValidationContext<'_>,
) -> Result<(), ConflictReason>
pub fn unlock( &self, _output_id: &OutputId, unlock: &Unlock, inputs: &[(OutputId, &Output)], context: &mut ValidationContext<'_>, ) -> Result<(), ConflictReason>
Sourcepub fn simple_deposit_address(&self) -> Option<&Address>
pub fn simple_deposit_address(&self) -> Option<&Address>
Returns the address of the unlock conditions if the output is a simple deposit. Simple deposit outputs are basic outputs with only an address unlock condition, no native tokens and no features. They are used to return storage deposits.
Trait Implementations§
Source§impl Clone for BasicOutput
impl Clone for BasicOutput
Source§fn clone(&self) -> BasicOutput
fn clone(&self) -> BasicOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BasicOutput
impl Debug for BasicOutput
Source§impl<'de> Deserialize<'de> for BasicOutput
impl<'de> Deserialize<'de> for BasicOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&BasicOutput> for BasicOutputBuilder
impl From<&BasicOutput> for BasicOutputBuilder
Source§fn from(output: &BasicOutput) -> Self
fn from(output: &BasicOutput) -> Self
Source§impl From<&BasicOutput> for BasicOutputDto
Available on crate feature dto only.
impl From<&BasicOutput> for BasicOutputDto
dto only.Source§fn from(value: &BasicOutput) -> Self
fn from(value: &BasicOutput) -> Self
Source§impl From<BasicOutput> for Output
impl From<BasicOutput> for Output
Source§fn from(original: BasicOutput) -> Output
fn from(original: BasicOutput) -> Output
Source§impl Hash for BasicOutput
impl Hash for BasicOutput
Source§impl Ord for BasicOutput
impl Ord for BasicOutput
Source§fn cmp(&self, other: &BasicOutput) -> Ordering
fn cmp(&self, other: &BasicOutput) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl Packable for BasicOutput
impl Packable for BasicOutput
Source§type UnpackError = Error
type UnpackError = Error
Source§type UnpackVisitor = ProtocolParameters
type UnpackVisitor = ProtocolParameters
Source§fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
Packer.Source§fn unpack<U: Unpacker, const VERIFY: bool>(
unpacker: &mut U,
visitor: &Self::UnpackVisitor,
) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
fn unpack<U: Unpacker, const VERIFY: bool>( unpacker: &mut U, visitor: &Self::UnpackVisitor, ) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
Unpacker. The VERIFY generic parameter can be used to skip additional
syntactic checks.Source§impl PartialEq for BasicOutput
impl PartialEq for BasicOutput
Source§fn eq(&self, other: &BasicOutput) -> bool
fn eq(&self, other: &BasicOutput) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for BasicOutput
impl PartialOrd for BasicOutput
Source§impl Serialize for BasicOutput
impl Serialize for BasicOutput
impl Eq for BasicOutput
impl StructuralPartialEq for BasicOutput
Auto Trait Implementations§
impl Freeze for BasicOutput
impl RefUnwindSafe for BasicOutput
impl Send for BasicOutput
impl Sync for BasicOutput
impl Unpin for BasicOutput
impl UnsafeUnpin for BasicOutput
impl UnwindSafe for BasicOutput
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
Source§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_verified<T>( bytes: T, visitor: &<P as Packable>::UnpackVisitor, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>].
Source§fn unpack_unverified<T>(
bytes: T,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_unverified<T>( bytes: T, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>] skipping some syntatical checks.
Source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
pack.