pub struct IdGenerator { /* private fields */ }Expand description
ID generator with configurable options
Implementations§
Source§impl IdGenerator
impl IdGenerator
pub fn new(config: IdGeneratorConfig) -> Self
pub fn with_defaults() -> Self
Sourcepub fn generate(
&self,
content: &Content,
semantic_role: Option<&str>,
) -> BlockId
pub fn generate( &self, content: &Content, semantic_role: Option<&str>, ) -> BlockId
Generate a block ID from content
Sourcepub fn content_hash(&self, content: &Content) -> ContentHash
pub fn content_hash(&self, content: &Content) -> ContentHash
Generate a content hash
Trait Implementations§
Source§impl Clone for IdGenerator
impl Clone for IdGenerator
Source§fn clone(&self) -> IdGenerator
fn clone(&self) -> IdGenerator
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 moreSource§impl Debug for IdGenerator
impl Debug for IdGenerator
Auto Trait Implementations§
impl Freeze for IdGenerator
impl RefUnwindSafe for IdGenerator
impl Send for IdGenerator
impl Sync for IdGenerator
impl Unpin for IdGenerator
impl UnwindSafe for IdGenerator
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