pub struct AnnotationBuilder { /* private fields */ }Expand description
Incrementally constructs document annotations while interning stream names.
Implementations§
Source§impl AnnotationBuilder
impl AnnotationBuilder
Sourcepub fn stream(&mut self, stream: impl Into<String>) -> StreamHandle
pub fn stream(&mut self, stream: impl Into<String>) -> StreamHandle
Intern a source stream name and return its reusable handle.
Sourcepub fn note(
&mut self,
id: impl Display,
stream: StreamHandle,
offset: u64,
) -> ProvenanceNote<'_>
pub fn note( &mut self, id: impl Display, stream: StreamHandle, offset: u64, ) -> ProvenanceNote<'_>
Record an entity’s source location.
The returned value supports the ergonomic
builder.note(&id, stream, offset).tag("face") form.
Sourcepub fn exactness(&mut self, id: impl Display, exactness: Exactness) -> &mut Self
pub fn exactness(&mut self, id: impl Display, exactness: Exactness) -> &mut Self
Set entity-level exactness. Byte-exact entries are removed to preserve the table’s sparse absent-means-byte-exact representation.
Sourcepub fn derived(
&mut self,
id: impl Display,
field: impl Into<String>,
) -> &mut Self
pub fn derived( &mut self, id: impl Display, field: impl Into<String>, ) -> &mut Self
Mark one serialized field as deterministically derived.
Sourcepub fn field_exactness(
&mut self,
id: impl Display,
field: impl Into<String>,
exactness: Exactness,
) -> &mut Self
pub fn field_exactness( &mut self, id: impl Display, field: impl Into<String>, exactness: Exactness, ) -> &mut Self
Set a serialized field’s exactness.
A byte-exact override is omitted because it is already the sparse default. Empty byte-exact notes are removed.
Sourcepub fn remove_entity(&mut self, id: impl Display)
pub fn remove_entity(&mut self, id: impl Display)
Remove all annotations for an entity that was removed from the model.
Sourcepub fn annotations(&self) -> &Annotations
pub fn annotations(&self) -> &Annotations
Borrow the annotations built so far.
Sourcepub fn build(self) -> Annotations
pub fn build(self) -> Annotations
Finish building and return the annotation tables.
Trait Implementations§
Source§impl Clone for AnnotationBuilder
impl Clone for AnnotationBuilder
Source§fn clone(&self) -> AnnotationBuilder
fn clone(&self) -> AnnotationBuilder
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 moreSource§impl Debug for AnnotationBuilder
impl Debug for AnnotationBuilder
Source§impl Default for AnnotationBuilder
impl Default for AnnotationBuilder
Source§fn default() -> AnnotationBuilder
fn default() -> AnnotationBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AnnotationBuilder
impl RefUnwindSafe for AnnotationBuilder
impl Send for AnnotationBuilder
impl Sync for AnnotationBuilder
impl Unpin for AnnotationBuilder
impl UnsafeUnpin for AnnotationBuilder
impl UnwindSafe for AnnotationBuilder
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