Struct grin_wallet_libwallet::OutputData
source · [−]pub struct OutputData {
pub root_key_id: Identifier,
pub key_id: Identifier,
pub n_child: u32,
pub commit: Option<String>,
pub mmr_index: Option<u64>,
pub value: u64,
pub status: OutputStatus,
pub height: u64,
pub lock_height: u64,
pub is_coinbase: bool,
pub tx_log_entry: Option<u32>,
}
Expand description
Information about an output that’s being tracked by the wallet. Must be enough to reconstruct the commitment associated with the ouput when the root private key is known.
Fields
root_key_id: Identifier
Root key_id that the key for this output is derived from
key_id: Identifier
Derived key for this output
n_child: u32
How many derivations down from the root key
commit: Option<String>
The actual commit, optionally stored
mmr_index: Option<u64>
PMMR Index, used on restore in case of duplicate wallets using the same key_id (2 wallets using same seed, for instance
value: u64
Value of the output, necessary to rebuild the commitment
status: OutputStatus
Current status of the output
height: u64
Height of the output
lock_height: u64
Height we are locked until
is_coinbase: bool
Is this a coinbase output? Is it subject to coinbase locktime?
tx_log_entry: Option<u32>
Optional corresponding internal entry in tx entry log
Implementations
sourceimpl OutputData
impl OutputData
sourcepub fn num_confirmations(&self, current_height: u64) -> u64
pub fn num_confirmations(&self, current_height: u64) -> u64
How many confirmations has this output received? If height == 0 then we are either Unconfirmed or the output was cut-through so we do not actually know how many confirmations this output had (and never will).
sourcepub fn eligible_to_spend(
&self,
current_height: u64,
minimum_confirmations: u64
) -> bool
pub fn eligible_to_spend(
&self,
current_height: u64,
minimum_confirmations: u64
) -> bool
Check if output is eligible to spend based on state and height and confirmations
sourcepub fn mark_unspent(&mut self)
pub fn mark_unspent(&mut self)
Marks this output as unspent if it was previously unconfirmed
sourcepub fn mark_spent(&mut self)
pub fn mark_spent(&mut self)
Mark an output as spent
sourcepub fn mark_reverted(&mut self)
pub fn mark_reverted(&mut self)
Mark an output as reverted
Trait Implementations
sourceimpl Clone for OutputData
impl Clone for OutputData
sourcefn clone(&self) -> OutputData
fn clone(&self) -> OutputData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for OutputData
impl Debug for OutputData
sourceimpl<'de> Deserialize<'de> for OutputData
impl<'de> Deserialize<'de> for OutputData
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for OutputData
impl Ord for OutputData
sourceimpl PartialEq<OutputData> for OutputData
impl PartialEq<OutputData> for OutputData
sourcefn eq(&self, other: &OutputData) -> bool
fn eq(&self, other: &OutputData) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &OutputData) -> bool
fn ne(&self, other: &OutputData) -> bool
This method tests for !=
.
sourceimpl PartialOrd<OutputData> for OutputData
impl PartialOrd<OutputData> for OutputData
sourcefn partial_cmp(&self, other: &OutputData) -> Option<Ordering>
fn partial_cmp(&self, other: &OutputData) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Readable for OutputData
impl Readable for OutputData
sourcefn read<R: Reader>(reader: &mut R) -> Result<OutputData, Error>
fn read<R: Reader>(reader: &mut R) -> Result<OutputData, Error>
Reads the data necessary to this Readable from the provided reader
sourceimpl Serialize for OutputData
impl Serialize for OutputData
sourceimpl Writeable for OutputData
impl Writeable for OutputData
impl Eq for OutputData
impl StructuralEq for OutputData
impl StructuralPartialEq for OutputData
Auto Trait Implementations
impl RefUnwindSafe for OutputData
impl Send for OutputData
impl Sync for OutputData
impl Unpin for OutputData
impl UnwindSafe for OutputData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CloneAny for T where
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global> where
T: Sync,
fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + Sync + Send + 'static, Global> where
T: Send + Sync,
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a Box
behind a trait object of this trait. Read more
fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of self
. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a Box
behind a trait object of this trait. Read more
fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of self
. Read more
impl<T> SafeBorrow<T> for T where
T: ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more