pub struct ReferenceGenerator { /* private fields */ }Expand description
Generates deterministic references for DDEX entities
Implementations§
Source§impl ReferenceGenerator
 
impl ReferenceGenerator
Sourcepub fn new(style: ReferenceStyle) -> Self
 
pub fn new(style: ReferenceStyle) -> Self
Create a new reference generator
Sourcepub fn generate(&mut self, entity_type: EntityType) -> String
 
pub fn generate(&mut self, entity_type: EntityType) -> String
Generate a new reference for an entity type
Sourcepub fn set_prefix(&mut self, entity_type: EntityType, prefix: String)
 
pub fn set_prefix(&mut self, entity_type: EntityType, prefix: String)
Set custom prefix for an entity type
Sourcepub fn reset_counter(&mut self, entity_type: EntityType)
 
pub fn reset_counter(&mut self, entity_type: EntityType)
Reset counter for an entity type
Sourcepub fn reset_all_counters(&mut self)
 
pub fn reset_all_counters(&mut self)
Reset all counters
Sourcepub fn get_counter(&self, entity_type: EntityType) -> u32
 
pub fn get_counter(&self, entity_type: EntityType) -> u32
Get current counter value for entity type
Trait Implementations§
Source§impl Clone for ReferenceGenerator
 
impl Clone for ReferenceGenerator
Source§fn clone(&self) -> ReferenceGenerator
 
fn clone(&self) -> ReferenceGenerator
Returns a duplicate of the value. Read more
1.0.0 · 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 ReferenceGenerator
impl RefUnwindSafe for ReferenceGenerator
impl Send for ReferenceGenerator
impl Sync for ReferenceGenerator
impl Unpin for ReferenceGenerator
impl UnwindSafe for ReferenceGenerator
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
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