Skip to main content

RawDocument

Struct RawDocument 

Source
pub struct RawDocument {
    pub path: String,
    pub content: String,
    pub last_view: Option<String>,
    pub view_meta: Option<String>,
    pub lossy: bool,
    pub encoding: String,
    pub mtime_ms: i64,
    pub size: i64,
    pub source_sha256: Option<String>,
    pub stream_token: Option<String>,
}

Fields§

§path: String§content: String§last_view: Option<String>§view_meta: Option<String>

Per-format view metadata (JSON string) restored from the database by read_document.

§lossy: bool

True only when even the detected encoding could not decode the bytes cleanly (genuinely garbled input): replacement characters were substituted.

§encoding: String

The encoding the content was decoded from. Saving re-encodes to this encoding.

§mtime_ms: i64

Modified time (ms since epoch) at read time. 0 if the platform does not report it.

§size: i64

Byte size at read time. With mtime_ms this is the cheap on-disk fingerprint.

§source_sha256: Option<String>

SHA-256 of text bytes at read time. Save uses it to reject stale in-place writes.

§stream_token: Option<String>

Opaque token for binary viewer URLs; the renderer never receives the path in that URL.

Trait Implementations§

Source§

impl Debug for RawDocument

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for RawDocument

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.