#[non_exhaustive]pub struct Token {
pub layout: Option<Layout>,
pub detected_break: Option<DetectedBreak>,
pub detected_languages: Vec<DetectedLanguage>,
pub provenance: Option<Provenance>,
pub style_info: Option<StyleInfo>,
/* private fields */
}Expand description
A detected token.
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.layout: Option<Layout>§detected_break: Option<DetectedBreak>Detected break at the end of a Token.
detected_languages: Vec<DetectedLanguage>A list of detected languages together with confidence.
provenance: Option<Provenance>👎Deprecated
The history of this annotation.
style_info: Option<StyleInfo>Text style attributes.
Implementations§
Source§impl Token
impl Token
pub fn new() -> Self
Sourcepub fn set_layout<T>(self, v: T) -> Self
pub fn set_layout<T>(self, v: T) -> Self
Sets the value of layout.
Sourcepub fn set_or_clear_layout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_layout<T>(self, v: Option<T>) -> Self
Sets or clears the value of layout.
Sourcepub fn set_detected_break<T>(self, v: T) -> Selfwhere
T: Into<DetectedBreak>,
pub fn set_detected_break<T>(self, v: T) -> Selfwhere
T: Into<DetectedBreak>,
Sets the value of detected_break.
Sourcepub fn set_or_clear_detected_break<T>(self, v: Option<T>) -> Selfwhere
T: Into<DetectedBreak>,
pub fn set_or_clear_detected_break<T>(self, v: Option<T>) -> Selfwhere
T: Into<DetectedBreak>,
Sets or clears the value of detected_break.
Sourcepub fn set_detected_languages<T, V>(self, v: T) -> Self
pub fn set_detected_languages<T, V>(self, v: T) -> Self
Sets the value of detected_languages.
Sourcepub fn set_provenance<T>(self, v: T) -> Selfwhere
T: Into<Provenance>,
👎Deprecated
pub fn set_provenance<T>(self, v: T) -> Selfwhere
T: Into<Provenance>,
Sets the value of provenance.
Sourcepub fn set_or_clear_provenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<Provenance>,
👎Deprecated
pub fn set_or_clear_provenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<Provenance>,
Sets or clears the value of provenance.
Sourcepub fn set_style_info<T>(self, v: T) -> Self
pub fn set_style_info<T>(self, v: T) -> Self
Sets the value of style_info.
Sourcepub fn set_or_clear_style_info<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_style_info<T>(self, v: Option<T>) -> Self
Sets or clears the value of style_info.
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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