pub(crate) struct Encoder<const MAX_SIZE: usize> {
state: State,
bytes: [u8; MAX_SIZE],
cursor: usize,
}Expand description
BER/DER encoder.
Fields§
§state: StateCurrent state.
bytes: [u8; MAX_SIZE]Bytes of the OID being BER-encoded in-progress.
cursor: usizeCurrent position within the byte buffer.
Implementations§
Source§impl<const MAX_SIZE: usize> Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> Encoder<MAX_SIZE>
Sourcepub(crate) const fn extend(oid: ObjectIdentifier<MAX_SIZE>) -> Self
pub(crate) const fn extend(oid: ObjectIdentifier<MAX_SIZE>) -> Self
Extend an existing OID.
Sourcepub(crate) const fn arc(self, arc: Arc) -> Result<Self>
pub(crate) const fn arc(self, arc: Arc) -> Result<Self>
Encode an Arc as base 128 into the internal buffer.
Sourcepub(crate) const fn finish(self) -> Result<ObjectIdentifier<MAX_SIZE>>
pub(crate) const fn finish(self) -> Result<ObjectIdentifier<MAX_SIZE>>
Finish encoding an OID.
Sourceconst fn encode_base128(self, arc: Arc) -> Result<Self>
const fn encode_base128(self, arc: Arc) -> Result<Self>
Encode base 128.
Trait Implementations§
Auto Trait Implementations§
impl<const MAX_SIZE: usize> Freeze for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> RefUnwindSafe for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> Send for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> Sync for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> Unpin for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> UnsafeUnpin for Encoder<MAX_SIZE>
impl<const MAX_SIZE: usize> UnwindSafe for Encoder<MAX_SIZE>
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