Struct rust_tokenizers::Offset
source · pub struct Offset {
pub begin: OffsetSize,
pub end: OffsetSize,
}
Expand description
Offset information (in unicode points) to relate a token back to its original input string
Fields§
§begin: OffsetSize
§end: OffsetSize
Implementations§
source§impl Offset
impl Offset
sourcepub fn new(begin: OffsetSize, end: OffsetSize) -> Offset
pub fn new(begin: OffsetSize, end: OffsetSize) -> Offset
Create a new offset from a begin and end positions
sourcepub fn into_option(self) -> Option<Offset>
pub fn into_option(self) -> Option<Offset>
Wrap the offset into an option
Trait Implementations§
source§impl<'de> Deserialize<'de> for Offset
impl<'de> Deserialize<'de> for Offset
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
source§impl PartialEq for Offset
impl PartialEq for Offset
source§impl PartialOrd for Offset
impl PartialOrd for Offset
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Offset
impl Eq for Offset
impl StructuralEq for Offset
impl StructuralPartialEq for Offset
Auto Trait Implementations§
impl RefUnwindSafe for Offset
impl Send for Offset
impl Sync for Offset
impl Unpin for Offset
impl UnwindSafe for Offset
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