Struct ChannelId
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§
§impl ChannelId
impl ChannelId
pub fn v1_from_funding_txid(txid: &[u8; 32], output_index: u16) -> ChannelId
pub fn v1_from_funding_txid(txid: &[u8; 32], output_index: u16) -> ChannelId
Create v1 channel ID based on a funding TX ID and output index
pub fn temporary_from_entropy_source<ES>(entropy_source: &ES) -> ChannelId
pub fn temporary_from_entropy_source<ES>(entropy_source: &ES) -> ChannelId
Create a temporary channel ID randomly, based on an entropy source.
pub fn from_bytes(data: [u8; 32]) -> ChannelId
pub fn from_bytes(data: [u8; 32]) -> ChannelId
Generic constructor; create a new channel ID from the provided data.
Use a more specific *_from_*
constructor when possible.
Trait Implementations§
§impl Ord for ChannelId
impl Ord for ChannelId
§impl PartialOrd for ChannelId
impl PartialOrd for ChannelId
§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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
§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
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request