pub struct StandardData {
Show 19 fields pub amount: Option<CurrencyAmount>, pub generic_typed_value: Option<GenericTypedValue>, pub peer_data: Option<PeerMetadata>, pub node_metadata: Option<NodeMetadata>, pub dynamic_node_metadata: Option<DynamicNodeMetadata>, pub height: Option<i64>, pub data_hash: Option<Hash>, pub hash: Option<Hash>, pub observation: Option<Observation>, pub address: Option<Address>, pub state: Option<BytesData>, pub request: Option<BytesData>, pub standard_request: Option<StandardRequest>, pub liquidity_request: Option<LiquidityRequest>, pub portfolio_info: Option<PortfolioInfo>, pub schema_def: Option<SchemaDef>, pub data: Option<BytesData>, pub aggregate_state_hash: Option<Hash>, pub external_transaction_id: Option<ExternalTransactionId>,
}
Expand description

Generic data structure designed to hold arbitrary data in a common format. This should be considered supplementary to using a regular schema, not a complete substitute.

Fields§

§amount: Option<CurrencyAmount>

Standard currency style field

§generic_typed_value: Option<GenericTypedValue>§peer_data: Option<PeerMetadata>

Where a peer (representing a person controlling multiple nodes from a cold wallet,) updates it’s metadata within a transaction

§node_metadata: Option<NodeMetadata>

Where an online or live node programmatically updates it’s own metadata using it’s live hot keys

§dynamic_node_metadata: Option<DynamicNodeMetadata>

Latest value associated with the online / hot node – updated more frequently and not necessarily tracked in every transaction, but kept here for reference.

§height: Option<i64>

Equivalent to ‘block height’, linear observation counter

§data_hash: Option<Hash>

Reference to externally resolved data

§hash: Option<Hash>

Pure hash reference, without necessarily being backed by any specific data.

§observation: Option<Observation>

Used for node transactions related to their internal observation formation, equivalent to a ‘local’ block

§address: Option<Address>

Used for referencing bitcoin address, kept here at top level for convenience

§state: Option<BytesData>

Used to store state information directly following eUTXO conventions

§request: Option<BytesData>

Contract style request, similar to Ethereum transaction for updating a smart contract, from an external user

§standard_request: Option<StandardRequest>

Contract style response, similar to above, but specifically typed to correspond to a ‘default’ schema driven request common to all contracts and available automatically in the SDK.

§liquidity_request: Option<LiquidityRequest>

Staking request, designed for use with the native AMM/Portfolio functions.

§portfolio_info: Option<PortfolioInfo>

Portfolio information, used for updating the current ‘target’ state of a portfolio

§schema_def: Option<SchemaDef>

Schema definition for the data, used for parsing and validation

§data: Option<BytesData>

Generic bytes data, used for storing arbitrary data

§aggregate_state_hash: Option<Hash>

For eUTXO style contracts, the hash of all state information aggregated from initial state origin. Can be re-calculated.

§external_transaction_id: Option<ExternalTransactionId>

A bitcoin txid for example

Implementations§

source§

impl StandardData

source

pub fn height(&self) -> i64

Returns the value of height, or the default value if height is unset.

source§

impl StandardData

source

pub fn observation(o: Observation) -> Self

source

pub fn empty() -> Self

source

pub fn peer_data(pd: PeerMetadata) -> Option<Self>

source

pub fn amount_data(amount: u64) -> Option<Self>

Trait Implementations§

source§

impl Clone for StandardData

source§

fn clone(&self) -> StandardData

Returns a copy 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 StandardData

source§

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

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

impl Default for StandardData

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for StandardData

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 StandardData

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 Message for StandardData

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 StandardData

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for StandardData

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 StandardData

source§

impl StructuralEq for StandardData

source§

impl StructuralPartialEq for StandardData

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> EasyJson for Twhere T: Serialize,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ProtoSerde for Twhere T: Message + Default,

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,