pub struct Document {
pub document_id: Option<String>,
pub title: Option<String>,
pub revision_id: Option<String>,
pub body: Option<Body>,
pub tabs: Vec<Tab>,
pub named_ranges: HashMap<String, NamedRanges>,
pub headers: HashMap<String, Header>,
pub footers: HashMap<String, Footer>,
pub footnotes: HashMap<String, Footnote>,
}Expand description
A document’s full structural model, from documents.get.
Deliberately not fields-masked when fetched — unlike
spreadsheets.get, whose mask exists to keep every cell out of the
response. A Docs mask has to spell nesting depth out literally, and a
table may contain a table to arbitrary depth, so any fixed-depth mask
silently drops document text below its deepest named level. See
crate::drive::docs::api.
Fields§
§document_id: Option<String>The document’s id (echoes the one requested).
title: Option<String>The document’s display title.
revision_id: Option<String>The revision this response reflects.
Google populates this only for callers with edit access, so a
read-only caller sees None. It is the writeControl
requiredRevisionId token a later documents.batchUpdate presents
to refuse a write against a document that moved underneath it.
body: Option<Body>Legacy single-tab content, populated only when the request did not
ask for tab content. Mutually exclusive with Self::tabs.
tabs: Vec<Tab>The tab tree, populated only when includeTabsContent=true.
named_ranges: HashMap<String, NamedRanges>Named ranges, keyed by name.
The stable way to address a region: an index shifts on every insertion, a named range’s name does not.
headers: HashMap<String, Header>Page headers, keyed by segmentId. Legacy shape only — see
Self::resolved_tabs.
Page footers, keyed by segmentId. Legacy shape only.
footnotes: HashMap<String, Footnote>Footnotes, keyed by segmentId. Legacy shape only.
Implementations§
Source§impl Document
impl Document
Sourcepub fn resolved_tabs(&self) -> Vec<ResolvedTab<'_>>
pub fn resolved_tabs(&self) -> Vec<ResolvedTab<'_>>
Every tab’s content, depth-first through childTabs, falling back to
the legacy top-level Self::body (and its sibling
headers/footers/footnotes maps) as a single anonymous tab.
The fallback is what makes the tabs-xor-body split invisible to
callers. A document fetched without includeTabsContent yields
exactly one ResolvedTab whose tab_id and title are None —
unless the document has neither body content nor any segment, in
which case there is nothing to synthesise a tab for.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
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>,
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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