pub struct IdentifierIssuer { /* private fields */ }Expand description
Issues monotonically increasing canonical blank node identifiers.
Each call to IdentifierIssuer::issue either returns the previously
assigned identifier for a blank node or mints a fresh one with the format
_:c14n<N>. The internal counter starts at 0.
Implementations§
Source§impl IdentifierIssuer
impl IdentifierIssuer
Sourcepub fn new(prefix: impl Into<String>) -> Self
pub fn new(prefix: impl Into<String>) -> Self
Create a new issuer using prefix as the canonical identifier prefix.
Sourcepub fn issue(&mut self, original: &str) -> String
pub fn issue(&mut self, original: &str) -> String
Return the canonical identifier that has been (or will be) assigned to
original. If this is the first call for original, a new identifier
is minted.
Sourcepub fn get(&self, original: &str) -> Option<&str>
pub fn get(&self, original: &str) -> Option<&str>
Return the canonical identifier for original if it has already been
issued, without minting a new one.
Sourcepub fn has_issued(&self, original: &str) -> bool
pub fn has_issued(&self, original: &str) -> bool
Return true if a canonical identifier has already been issued for
original.
Sourcepub fn issued_pairs(&self) -> impl Iterator<Item = (&str, &str)>
pub fn issued_pairs(&self) -> impl Iterator<Item = (&str, &str)>
Return an iterator over (original, canonical) pairs in issue order.
Trait Implementations§
Source§impl Clone for IdentifierIssuer
impl Clone for IdentifierIssuer
Source§fn clone(&self) -> IdentifierIssuer
fn clone(&self) -> IdentifierIssuer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IdentifierIssuer
impl RefUnwindSafe for IdentifierIssuer
impl Send for IdentifierIssuer
impl Sync for IdentifierIssuer
impl Unpin for IdentifierIssuer
impl UnsafeUnpin for IdentifierIssuer
impl UnwindSafe for IdentifierIssuer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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