Skip to main content

OwnedOid

Struct OwnedOid 

Source
pub struct OwnedOid { /* private fields */ }
Expand description

An independently owned object identifier with retained capacity accounting.

Its immutable storage is validated at construction. Borrowing its OID view does not rescan the encoded arcs; callers admit subsequent comparisons or traversal in the execution domain of the current operation.

Implementations§

Source§

impl OwnedOid

Source

pub fn parse(text: &str, execution: &Memory) -> Result<Self>

Parses strict dotted-decimal numericOID text into owned encoded arcs.

Uses RFC4512 §1.4’s decimal-component grammar (at least two components, no padded decimal component) and ASN.1’s first/second arc restrictions. Arc width is unrestricted by machine integers. Work, scratch, copying and capacity are admitted before execution; the result keeps its charge.

§Errors

Returns MalformedOid at the offending text offset, or a distinct resource error before unfunded conversion/allocation.

Source

pub fn parse_in<W: Work>(text: &str, execution: &W) -> Result<Self>

Parses using the current operation’s work and storage admission. The returned allocation retains its original account, not a borrowed parser/execution scope. Grammar and conversion share Self::parse’s kernel; aggregate and local refusal remain distinct resource errors.

Source

pub fn from_oid(value: Oid<'_>, execution: &Memory) -> Result<Self, MemoryError>

Copies an already validated identifier into the supplied storage domain. The original encoding and source remain unchanged on resource refusal.

Source

pub fn from_oid_in<W: Work>( value: Oid<'_>, execution: &W, ) -> Result<Self, MemoryError>

Retains validated arcs after funding copying/capacity in current work. The resulting owner keeps its allocation but no borrowed parser budget.

Source

pub fn as_oid(&self) -> Oid<'_>

A constant-time borrowed view of the validated immutable encoding.

Trait Implementations§

Source§

impl Debug for OwnedOid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.