#[non_exhaustive]pub struct Chunk {
pub chunk_id: String,
pub source_block_ids: Vec<String>,
pub content: String,
pub page_span: Option<ChunkPageSpan>,
pub page_headers: Vec<ChunkPageHeader>,
pub page_footers: Vec<ChunkPageFooter>,
/* private fields */
}Expand description
Represents a chunk.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chunk_id: StringID of the chunk.
source_block_ids: Vec<String>Unused.
content: StringText content of the chunk.
page_span: Option<ChunkPageSpan>Page span of the chunk.
page_headers: Vec<ChunkPageHeader>Page headers associated with the chunk.
Page footers associated with the chunk.
Implementations§
Source§impl Chunk
impl Chunk
pub fn new() -> Self
Sourcepub fn set_chunk_id<T: Into<String>>(self, v: T) -> Self
pub fn set_chunk_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_source_block_ids<T, V>(self, v: T) -> Self
pub fn set_source_block_ids<T, V>(self, v: T) -> Self
Sets the value of source_block_ids.
§Example
ⓘ
let x = Chunk::new().set_source_block_ids(["a", "b", "c"]);Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_page_span<T>(self, v: T) -> Selfwhere
T: Into<ChunkPageSpan>,
pub fn set_page_span<T>(self, v: T) -> Selfwhere
T: Into<ChunkPageSpan>,
Sourcepub fn set_or_clear_page_span<T>(self, v: Option<T>) -> Selfwhere
T: Into<ChunkPageSpan>,
pub fn set_or_clear_page_span<T>(self, v: Option<T>) -> Selfwhere
T: Into<ChunkPageSpan>,
Sourcepub fn set_page_headers<T, V>(self, v: T) -> Self
pub fn set_page_headers<T, V>(self, v: T) -> Self
Sets the value of page_headers.
§Example
ⓘ
use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageHeader;
let x = Chunk::new()
.set_page_headers([
ChunkPageHeader::default()/* use setters */,
ChunkPageHeader::default()/* use (different) setters */,
]);Sets the value of page_footers.
§Example
ⓘ
use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageFooter;
let x = Chunk::new()
.set_page_footers([
ChunkPageFooter::default()/* use setters */,
ChunkPageFooter::default()/* use (different) setters */,
]);Trait Implementations§
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
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