Output

Struct Output 

Source
pub struct Output {
    pub address: Option<Address>,
    pub product_id: Option<ProductId>,
    pub counter_party_proofs: Vec<Proof>,
    pub data: Option<StandardData>,
    pub contract: Option<OutputContract>,
    pub output_type: Option<i32>,
    pub utxo_id: Option<UtxoId>,
}

Fields§

§address: Option<Address>

Basic unlock condition for using this as a consumable input. Script hash or hash of a public key.

§product_id: Option<ProductId>§counter_party_proofs: Vec<Proof>§data: Option<StandardData>

change to outputData?

§contract: Option<OutputContract>§output_type: Option<i32>§utxo_id: Option<UtxoId>

Used for specifying UTXO contract reference as well as address.

Implementations§

Source§

impl Output

Source

pub fn output_type(&self) -> OutputType

Returns the enum value of output_type, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_output_type(&mut self, value: OutputType)

Sets output_type to the provided enum value.

Source§

impl Output

Source

pub fn is_request(&self) -> bool

Source

pub fn is_multisig(&self) -> bool

Source

pub fn multisig_threshold_naive(&self) -> Option<i64>

Source

pub fn is_deploy(&self) -> bool

Source

pub fn code(&self) -> Option<Vec<u8>>

Source

pub fn validate_deploy_code(&self) -> RgResult<Vec<u8>>

Source

pub fn pay_update_descendents(&self) -> bool

Source

pub fn request_data(&self) -> RgResult<&Vec<u8>>

Source

pub fn request_contention_key(&self) -> RgResult<ContentionKey>

Source

pub fn request_selector(&self) -> RgResult<Option<&StateSelector>>

Source

pub fn new(address: &Address, amount: i64) -> Output

Source

pub fn from_data(data: StandardData) -> Self

Source

pub fn is_swap(&self) -> bool

Source

pub fn is_swap_fulfillment(&self) -> bool

Source

pub fn stake_request(&self) -> Option<&StakeRequest>

Source

pub fn is_peer_data(&self) -> bool

Source

pub fn is_node_metadata(&self) -> bool

Source

pub fn is_metadata(&self) -> bool

Source

pub fn request(&self) -> Option<&StandardRequest>

Source

pub fn response(&self) -> Option<&StandardResponse>

Source

pub fn swap_fulfillment(&self) -> Option<&SwapFulfillment>

Source

pub fn swap_request(&self) -> Option<&SwapRequest>

Source

pub fn is_stake(&self) -> bool

Source

pub fn is_fee(&self) -> bool

Source

pub fn utxo_entry( &self, transaction_hash: &Hash, output_index: i64, time: i64, ) -> UtxoEntry

Source

pub fn amount(&self) -> u64

Source

pub fn amount_i64(&self) -> i64

Source

pub fn safe_ensure_amount(&self) -> Result<&i64, ErrorInfo>

Source

pub fn observation(&self) -> RgResult<&Observation>

Source

pub fn opt_amount(&self) -> Option<i64>

Source

pub fn opt_amount_typed(&self) -> Option<CurrencyAmount>

Source

pub fn opt_amount_typed_ref(&self) -> Option<&CurrencyAmount>

Source

pub fn rounded_amount(&self) -> f64

Trait Implementations§

Source§

impl Clone for Output

Source§

fn clone(&self) -> Output

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Output

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Output

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Output

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Output

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl HashClear for Output

Source§

fn hash_clear(&mut self)

Source§

impl Message for Output

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Output

Source§

fn eq(&self, other: &Output) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Output

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Output

Source§

impl StructuralPartialEq for Output

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EasyJson for T
where T: Serialize,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> ProtoHashable for T
where T: HashClear + Clone + Message + Default,

Source§

fn calculate_hash(&self) -> Hash

Source§

fn div_mod(&self, bucket: usize) -> i64

Source§

impl<T> ProtoSerde for T
where T: Message + Default,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerdeCborConverters for T
where T: Serialize + for<'a> Deserialize<'a>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,