pub struct ChannelId(pub [u8; 32]);
Expand description
A unique 32-byte identifier for a channel. Depending on how the ID is generated, several varieties are distinguished (but all are stored as 32 bytes): v1 and temporary. A v1 channel ID is generated based on funding tx outpoint (txid & index). A temporary ID is generated randomly. (Later revocation-point-based v2 is a possibility.) The variety (context) is not stored, it is relevant only at creation.
This is not exported to bindings users as we just use [u8; 32] directly.
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl ChannelId
impl ChannelId
sourcepub fn v1_from_funding_txid(txid: &[u8; 32], output_index: u16) -> Self
pub fn v1_from_funding_txid(txid: &[u8; 32], output_index: u16) -> Self
Create v1 channel ID based on a funding TX ID and output index
sourcepub fn temporary_from_entropy_source<ES: Deref>(entropy_source: &ES) -> Selfwhere
ES::Target: EntropySource,
pub fn temporary_from_entropy_source<ES: Deref>(entropy_source: &ES) -> Selfwhere
ES::Target: EntropySource,
Create a temporary channel ID randomly, based on an entropy source.
sourcepub fn from_bytes(data: [u8; 32]) -> Self
pub fn from_bytes(data: [u8; 32]) -> Self
Generic constructor; create a new channel ID from the provided data.
Use a more specific *_from_*
constructor when possible.
Trait Implementations§
source§impl Ord for ChannelId
impl Ord for ChannelId
source§impl PartialEq for ChannelId
impl PartialEq for ChannelId
source§impl PartialOrd for ChannelId
impl PartialOrd for ChannelId
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 moresource§impl Writeable for ChannelId
impl Writeable for ChannelId
impl Copy for ChannelId
impl Eq for ChannelId
impl StructuralPartialEq for ChannelId
Auto Trait Implementations§
impl Freeze for ChannelId
impl RefUnwindSafe for ChannelId
impl Send for ChannelId
impl Sync for ChannelId
impl Unpin for ChannelId
impl UnwindSafe for ChannelId
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