pub struct Magic(/* private fields */);
Expand description
Network magic bytes to identify the cryptocurrency network the message was intended for.
Implementations§
source§impl Magic
impl Magic
sourcepub const TESTNET: Self = _
👎Deprecated since 0.32.4: Use TESTNET3 instead
pub const TESTNET: Self = _
Bitcoin testnet3 network magic bytes.
sourcepub fn from_bytes(bytes: [u8; 4]) -> Magic
pub fn from_bytes(bytes: [u8; 4]) -> Magic
Create network magic from bytes.
sourcepub fn from_params(params: impl AsRef<Params>) -> Self
pub fn from_params(params: impl AsRef<Params>) -> Self
Returns the magic bytes for the network defined by params
.
Trait Implementations§
source§impl Ord for Magic
impl Ord for Magic
source§impl PartialEq<Magic> for Magic
impl PartialEq<Magic> for Magic
source§impl PartialOrd<Magic> for Magic
impl PartialOrd<Magic> for Magic
1.0.0 · source§fn 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 moreimpl Copy for Magic
impl Eq for Magic
impl StructuralEq for Magic
impl StructuralPartialEq for Magic
Auto Trait Implementations§
impl RefUnwindSafe for Magic
impl Send for Magic
impl Sync for Magic
impl Unpin for Magic
impl UnwindSafe for Magic
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