Struct Magic
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
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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