Struct libp2p_webrtc::tokio::Fingerprint
source · pub struct Fingerprint(/* private fields */);
Available on crate feature
tokio
only.Expand description
A certificate fingerprint that is assumed to be created using the SHA256 hash algorithm.
Implementations§
source§impl Fingerprint
impl Fingerprint
sourcepub fn from_certificate(bytes: &[u8]) -> Self
pub fn from_certificate(bytes: &[u8]) -> Self
Creates a fingerprint from a raw certificate.
sourcepub fn try_from_rtc_dtls(fp: &RTCDtlsFingerprint) -> Option<Self>
pub fn try_from_rtc_dtls(fp: &RTCDtlsFingerprint) -> Option<Self>
Converts RTCDtlsFingerprint
to Fingerprint
.
sourcepub fn try_from_multihash(hash: Multihash<64>) -> Option<Self>
pub fn try_from_multihash(hash: Multihash<64>) -> Option<Self>
Converts Multihash
to Fingerprint
.
sourcepub fn to_multihash(self) -> Multihash<64>
pub fn to_multihash(self) -> Multihash<64>
Converts this fingerprint to Multihash
.
sourcepub fn to_sdp_format(self) -> String
pub fn to_sdp_format(self) -> String
Formats this fingerprint as uppercase hex, separated by colons (:
).
This is the format described in https://www.rfc-editor.org/rfc/rfc4572#section-5.
sourcepub fn algorithm(&self) -> String
pub fn algorithm(&self) -> String
Returns the algorithm used (e.g. “sha-256”). See https://datatracker.ietf.org/doc/html/rfc8122#section-5
Trait Implementations§
source§impl Clone for Fingerprint
impl Clone for Fingerprint
source§fn clone(&self) -> Fingerprint
fn clone(&self) -> Fingerprint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Fingerprint
impl Debug for Fingerprint
source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
impl Copy for Fingerprint
impl Eq for Fingerprint
impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more