Struct nakamoto_node::client::protocol::fees::FeeEstimate
[−]Expand description
Fee rate estimate for a single block. Measured in satoshis/vByte.
Fields
low: u64The lowest fee rate included in the block.
median: u64The median fee rate of the block.
high: u64The highest fee rate included in the block.
Implementations
impl FeeEstimate
impl FeeEstimate
pub fn from(fees: Vec<u64, Global>) -> Option<FeeEstimate>
pub fn from(fees: Vec<u64, Global>) -> Option<FeeEstimate>
Calculate a fee estimate from a list of fees.
Returns None if the list is empty.
use nakamoto_p2p::protocol::fees::FeeEstimate;
assert_eq!(
FeeEstimate::from(vec![3, 9, 2]),
Some(FeeEstimate { low: 2, median: 3, high: 9 }),
);
assert_eq!(
FeeEstimate::from(vec![4, 6]),
Some(FeeEstimate { low: 4, median: 5, high: 6 }),
);
assert_eq!(
FeeEstimate::from(vec![9, 2, 1, 7]),
Some(FeeEstimate { low: 1, median: 5, high: 9 }),
);
assert_eq!(
FeeEstimate::from(vec![3]),
Some(FeeEstimate { low: 3, median: 3, high: 3 }),
);
assert_eq!(FeeEstimate::from(vec![]), None);Trait Implementations
impl Clone for FeeEstimate
impl Clone for FeeEstimate
fn clone(&self) -> FeeEstimate
fn clone(&self) -> FeeEstimate
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 moreimpl Debug for FeeEstimate
impl Debug for FeeEstimate
impl PartialEq<FeeEstimate> for FeeEstimate
impl PartialEq<FeeEstimate> for FeeEstimate
fn eq(&self, other: &FeeEstimate) -> bool
fn eq(&self, other: &FeeEstimate) -> bool
impl Eq for FeeEstimate
impl StructuralEq for FeeEstimate
impl StructuralPartialEq for FeeEstimate
Auto Trait Implementations
impl RefUnwindSafe for FeeEstimate
impl Send for FeeEstimate
impl Sync for FeeEstimate
impl Unpin for FeeEstimate
impl UnwindSafe for FeeEstimate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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