Trait bitcoin_units::amount::serde::SerdeAmount

source ·
pub trait SerdeAmount: Copy + Sized {
    // Required methods
    fn ser_sat<S: Serializer>(self, s: S, _: Token) -> Result<S::Ok, S::Error>;
    fn des_sat<'d, D: Deserializer<'d>>(
        d: D,
        _: Token,
    ) -> Result<Self, D::Error>;
    fn ser_btc<S: Serializer>(self, s: S, _: Token) -> Result<S::Ok, S::Error>;
    fn des_btc<'d, D: Deserializer<'d>>(
        d: D,
        _: Token,
    ) -> Result<Self, D::Error>;
}
Available on crate feature serde only.
Expand description

This trait is used only to avoid code duplication and naming collisions of the different serde serialization crates.

Required Methods§

source

fn ser_sat<S: Serializer>(self, s: S, _: Token) -> Result<S::Ok, S::Error>

source

fn des_sat<'d, D: Deserializer<'d>>(d: D, _: Token) -> Result<Self, D::Error>

source

fn ser_btc<S: Serializer>(self, s: S, _: Token) -> Result<S::Ok, S::Error>

Available on crate feature alloc only.
source

fn des_btc<'d, D: Deserializer<'d>>(d: D, _: Token) -> Result<Self, D::Error>

Available on crate feature alloc only.

Object Safety§

This trait is not object safe.

Implementors§