pub struct MpintRef<'a>(/* private fields */);Expand description
A non-negative SSH mpint borrowing its unsigned big-endian magnitude.
Use Self::from_bytes to encode an existing magnitude. crate::Decoder::read_mpint_bytes
decodes a wire value into caller-provided storage. Both operations are variable-time.
Implementations§
Source§impl<'a> MpintRef<'a>
impl<'a> MpintRef<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self>
Borrow an unsigned big-endian magnitude, stripping any leading zeros.
§Errors
Returns Error::Length if the magnitude exceeds Self::MAX_SIZE.
Trait Implementations§
impl<'a> Copy for MpintRef<'a>
Source§impl Encode for MpintRef<'_>
impl Encode for MpintRef<'_>
Source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Get the length of this type encoded in bytes, prior to Base64 encoding. Read more
Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a
uint32 length prefix. Read moreAuto Trait Implementations§
impl<'a> Forget for MpintRef<'a>
impl<'a> Freeze for MpintRef<'a>
impl<'a> Move for MpintRef<'a>
impl<'a> RefUnwindSafe for MpintRef<'a>
impl<'a> Send for MpintRef<'a>
impl<'a> Sync for MpintRef<'a>
impl<'a> Unpin for MpintRef<'a>
impl<'a> UnsafeUnpin for MpintRef<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for MpintRef<'a>where
&'a [u8]: UnwindSafe,
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