pub struct ContentLayers {
pub body: bool,
pub furniture: bool,
pub notes: bool,
pub invisible: bool,
}Expand description
A set of content layers, body included — docling-core’s
set[ContentLayer] (HTMLParams.layers,
export_to_html(included_content_layers=…)), where body is a member
like any other. Default is docling’s DEFAULT_CONTENT_LAYERS: body
only, so an export built with it is unchanged from before layers could
be chosen (#499).
Fields§
§body: boolThe main content (items without an explicit layer).
furniture: boolContentLayer::Furniture: page headers/footers, navigation chrome.
notes: boolContentLayer::Notes: reviewer comments and other editorial notes.
invisible: boolContentLayer::Invisible: hidden content (hidden sheets, …).
Implementations§
Source§impl ContentLayers
impl ContentLayers
Sourcepub const fn with(self, layer: ContentLayer) -> Self
pub const fn with(self, layer: ContentLayer) -> Self
The set plus layer.
Sourcepub fn contains(&self, layer: Option<ContentLayer>) -> bool
pub fn contains(&self, layer: Option<ContentLayer>) -> bool
Whether layer is in the set; None is the body layer.
Sourcepub fn contains_name(&self, name: &str) -> bool
pub fn contains_name(&self, name: &str) -> bool
Whether the layer spelled name (body, furniture, notes,
invisible — the JSON content_layer values) is in the set; an
unknown name is not.
Sourcepub fn parse_list(list: &str) -> Result<Self, String>
pub fn parse_list(list: &str) -> Result<Self, String>
Parse a comma-separated list of layer names (body,furniture;
whitespace around a name is ignored, all is every layer). An
unknown name is the error. docling-core 2.99’s background layer
(watermarks) has no items in this model, so the name is accepted and
adds nothing — a set written for Python keeps parsing.
Trait Implementations§
Source§impl Clone for ContentLayers
impl Clone for ContentLayers
impl Copy for ContentLayers
Source§impl Debug for ContentLayers
impl Debug for ContentLayers
Source§impl Default for ContentLayers
impl Default for ContentLayers
impl Eq for ContentLayers
Source§impl Hash for ContentLayers
impl Hash for ContentLayers
Source§impl PartialEq for ContentLayers
impl PartialEq for ContentLayers
impl StructuralPartialEq for ContentLayers
Auto Trait Implementations§
impl Freeze for ContentLayers
impl RefUnwindSafe for ContentLayers
impl Send for ContentLayers
impl Sync for ContentLayers
impl Unpin for ContentLayers
impl UnsafeUnpin for ContentLayers
impl UnwindSafe for ContentLayers
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.