pub struct OutputDiff { /* private fields */ }
Expand description
A type to record output and treasury changes that happened within a milestone.
Implementations§
Source§impl OutputDiff
impl OutputDiff
Sourcepub fn new(
created_outputs: Vec<OutputId>,
consumed_outputs: Vec<OutputId>,
treasury_diff: Option<TreasuryDiff>,
) -> Result<Self, Error>
pub fn new( created_outputs: Vec<OutputId>, consumed_outputs: Vec<OutputId>, treasury_diff: Option<TreasuryDiff>, ) -> Result<Self, Error>
Creates a new OutputDiff
.
Sourcepub fn created_outputs(&self) -> &[OutputId]
pub fn created_outputs(&self) -> &[OutputId]
Returns the created outputs of the OutputDiff
.
Sourcepub fn consumed_outputs(&self) -> &[OutputId]
pub fn consumed_outputs(&self) -> &[OutputId]
Returns the consumed outputs of the OutputDiff
.
Sourcepub fn treasury_diff(&self) -> Option<&TreasuryDiff>
pub fn treasury_diff(&self) -> Option<&TreasuryDiff>
Returns the treasury diff of the OutputDiff
.
Trait Implementations§
Source§impl Clone for OutputDiff
impl Clone for OutputDiff
Source§fn clone(&self) -> OutputDiff
fn clone(&self) -> OutputDiff
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OutputDiff
impl Debug for OutputDiff
Source§impl Packable for OutputDiff
impl Packable for OutputDiff
Source§type UnpackError = Error
type UnpackError = Error
The error type that can be returned if some semantic error occurs while unpacking. Read more
Source§type UnpackVisitor = <VecPrefix<OutputId, u32> as Packable>::UnpackVisitor
type UnpackVisitor = <VecPrefix<OutputId, u32> as Packable>::UnpackVisitor
FIXME: docs
Source§fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
Packs this value into the given
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>>
Unpacks this value from the given
Unpacker
. The VERIFY
generic parameter can be used to skip additional
syntactic checks.Source§impl PartialEq for OutputDiff
impl PartialEq for OutputDiff
impl Eq for OutputDiff
impl StructuralPartialEq for OutputDiff
Auto Trait Implementations§
impl Freeze for OutputDiff
impl RefUnwindSafe for OutputDiff
impl Send for OutputDiff
impl Sync for OutputDiff
impl Unpin for OutputDiff
impl UnwindSafe for OutputDiff
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Returns the length in bytes of the value after being packed. The returned value always matches the number of
bytes written using
pack
.