pub enum ExplanationContentRange {
BlockText {
path: Vec<ExplanationBlockStep>,
start_char: u32,
end_char: u32,
},
DefinitionTerm {
path: Vec<ExplanationBlockStep>,
item_index: u32,
term_index: u32,
start_char: u32,
end_char: u32,
},
}Expand description
Half-open Unicode scalar offsets rooted in this response’s original body. The path does not reference the full source document or a preview window.
Variants§
BlockText
Safe visible text of a paragraph, preformatted, equation or unsupported leaf.
Fields
§
path: Vec<ExplanationBlockStep>Typed path to that leaf, starting at content.block.
DefinitionTerm
Safe visible inline text of exactly one original definition term.
Fields
§
path: Vec<ExplanationBlockStep>Typed path to a definition-list block.
Implementations§
Source§impl ExplanationContentRange
impl ExplanationContentRange
Sourcepub fn resolve<'a>(&self, content: &'a Block) -> Option<ExplanationTextRoot<'a>>
pub fn resolve<'a>(&self, content: &'a Block) -> Option<ExplanationTextRoot<'a>>
Validated borrowed target rooted in a returned content block. Invalid paths, wrong owner kinds, empty/inverted or out-of-range spans return None. Consumers must not compensate by searching the text again.
Sourcepub fn char_range(&self) -> Range<usize> ⓘ
pub fn char_range(&self) -> Range<usize> ⓘ
Half-open scalar range, to be used only after target validation.
Trait Implementations§
Source§impl Clone for ExplanationContentRange
impl Clone for ExplanationContentRange
Source§fn clone(&self) -> ExplanationContentRange
fn clone(&self) -> ExplanationContentRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExplanationContentRange
impl Debug for ExplanationContentRange
Source§impl<'de> Deserialize<'de> for ExplanationContentRange
impl<'de> Deserialize<'de> for ExplanationContentRange
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 ExplanationContentRange
Source§impl JsonSchema for ExplanationContentRange
impl JsonSchema for ExplanationContentRange
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ExplanationContentRange
impl PartialEq for ExplanationContentRange
Source§impl Serialize for ExplanationContentRange
impl Serialize for ExplanationContentRange
impl StructuralPartialEq for ExplanationContentRange
Auto Trait Implementations§
impl Freeze for ExplanationContentRange
impl RefUnwindSafe for ExplanationContentRange
impl Send for ExplanationContentRange
impl Sync for ExplanationContentRange
impl Unpin for ExplanationContentRange
impl UnsafeUnpin for ExplanationContentRange
impl UnwindSafe for ExplanationContentRange
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