pub struct ParsedMultikey { /* private fields */ }Expand description
A multikey decoded into its codec metadata and raw public key bytes.
Its metadata cannot be replaced after parsing: binding validation relies on the codec and algorithm being the ones established by the parser.
ⓘ
use codec_multikey::parse_multikey;
if let Ok(mut parsed) = parse_multikey("invalid") {
parsed.alg = "Ed25519";
}Implementations§
Source§impl ParsedMultikey
impl ParsedMultikey
Sourcepub const fn codec_name(&self) -> &'static str
pub const fn codec_name(&self) -> &'static str
Returns the canonical multicodec name established by parsing.
Sourcepub const fn algorithm_name(&self) -> &'static str
pub const fn algorithm_name(&self) -> &'static str
Returns the algorithm name associated with the parsed codec.
Sourcepub fn public_key(&self) -> &[u8] ⓘ
pub fn public_key(&self) -> &[u8] ⓘ
Borrows the validated public key bytes.
Sourcepub const fn key_length(&self) -> KeyLength
pub const fn key_length(&self) -> KeyLength
Returns the length policy associated with the parsed codec.
Sourcepub fn into_public_key(self) -> Vec<u8> ⓘ
pub fn into_public_key(self) -> Vec<u8> ⓘ
Transfers ownership of the validated public key bytes.
Auto Trait Implementations§
impl Freeze for ParsedMultikey
impl RefUnwindSafe for ParsedMultikey
impl Send for ParsedMultikey
impl Sync for ParsedMultikey
impl Unpin for ParsedMultikey
impl UnsafeUnpin for ParsedMultikey
impl UnwindSafe for ParsedMultikey
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