pub struct Magic(/* private fields */);
Expand description
Network magic bytes to identify the cryptocurrency network the message was intended for.
Implementations§
§impl Magic
impl Magic
pub const TESTNET: Magic = _
👎Deprecated since 0.32.4: Use TESTNET3 instead
pub const TESTNET: Magic = _
Bitcoin testnet3 network magic bytes.
pub fn from_bytes(bytes: [u8; 4]) -> Magic
pub fn from_bytes(bytes: [u8; 4]) -> Magic
Create network magic from bytes.
pub fn from_params(params: impl AsRef<Params>) -> Magic
pub fn from_params(params: impl AsRef<Params>) -> Magic
Returns the magic bytes for the network defined by params
.
Trait Implementations§
§impl BorrowMut<[u8]> for Magic
impl BorrowMut<[u8]> for Magic
§fn borrow_mut(&mut self) -> &mut [u8] ⓘ
fn borrow_mut(&mut self) -> &mut [u8] ⓘ
Mutably borrows from an owned value. Read more
§impl BorrowMut<[u8; 4]> for Magic
impl BorrowMut<[u8; 4]> for Magic
§fn borrow_mut(&mut self) -> &mut [u8; 4]
fn borrow_mut(&mut self) -> &mut [u8; 4]
Mutably borrows from an owned value. Read more
§impl Ord for Magic
impl Ord for Magic
§impl PartialOrd for Magic
impl PartialOrd for Magic
§fn partial_cmp(&self, other: &Magic) -> Option<Ordering>
fn partial_cmp(&self, other: &Magic) -> Option<Ordering>
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 StructuralPartialEq for Magic
Auto Trait Implementations§
impl Freeze for Magic
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more