pub struct Digest { /* private fields */ }Expand description
A digest of one document.
prose is present only when a model wrote one, and carries suspect
with it for as long as it exists. There is no method that clears the
flag: a summary does not stop being a summary by being read twice.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn structural(source: B3Hash, origin: Option<Locator>, text: &str) -> Digest
pub fn structural(source: B3Hash, origin: Option<Locator>, text: &str) -> Digest
The mechanical digest: structure only, and nothing to distrust.
Sourcepub fn with_prose(self, prose: String) -> Digest
pub fn with_prose(self, prose: String) -> Digest
Adds the prose a model wrote. It is suspect from here on, which is why this consumes and returns rather than mutating in place: the value that carries prose is a different value.
pub fn source(&self) -> B3Hash
pub fn origin(&self) -> Option<&Locator>
pub fn structure(&self) -> &[StructureNode]
pub fn prose(&self) -> Option<&str>
Sourcepub fn is_suspect(&self) -> bool
pub fn is_suspect(&self) -> bool
True while any part of this digest was written rather than read.
Sourcepub fn window_header(&self) -> String
pub fn window_header(&self) -> String
How a digest introduces itself in a window. A suspect digest says so and says where the source is, so the reader can go and check rather than believing a paraphrase.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
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