Trait VtxoRef

Source
pub trait VtxoRef<P: Policy = VtxoPolicy> {
    // Required methods
    fn vtxo_id(&self) -> VtxoId;
    fn into_full_vtxo(self) -> Option<Vtxo<Full, P>>
       where Self: Sized;

    // Provided methods
    fn as_bare_vtxo(&self) -> Option<Cow<'_, Vtxo<Bare, P>>> { ... }
    fn as_full_vtxo(&self) -> Option<&Vtxo<Full, P>> { ... }
}
Expand description

Implemented on anything that is kinda a Vtxo

Required Methods§

Source

fn vtxo_id(&self) -> VtxoId

The VtxoId of the VTXO

Source

fn into_full_vtxo(self) -> Option<Vtxo<Full, P>>
where Self: Sized,

If the bare Vtxo can be provided, provides it by value, either directly or via cloning

Provided Methods§

Source

fn as_bare_vtxo(&self) -> Option<Cow<'_, Vtxo<Bare, P>>>

If the bare Vtxo can be provided, provides it by reference

Source

fn as_full_vtxo(&self) -> Option<&Vtxo<Full, P>>

If the bare Vtxo can be provided, provides it by reference

Implementors§

Source§

impl<'a, P: Policy> VtxoRef<P> for &'a Vtxo<Bare, P>

Source§

impl<'a, P: Policy> VtxoRef<P> for &'a Vtxo<Full, P>

Source§

impl<'a, P: Policy> VtxoRef<P> for &'a VtxoId

Source§

impl<P: Policy> VtxoRef<P> for Vtxo<Bare, P>

Source§

impl<P: Policy> VtxoRef<P> for Vtxo<Full, P>

Source§

impl<P: Policy> VtxoRef<P> for VtxoId