pub trait OffsetType:
Copy
+ Default
+ PartialOrd
+ Sub<Output = Self> {
const SIZE: usize;
// Required methods
fn from_usize(value: usize) -> Option<Self>;
fn to_usize(self) -> usize;
}Expand description
Trait for offset types used in CharsTape.
This trait defines the interface for offset types that can be used to index
into the string data buffer. Implementations are provided for i32 and i64
to match Apache Arrow’s String and LargeString array types, and for u32 and
u64 when unsigned offsets are desired (note: Arrow interop is i32/i64-only).
Required Associated Constants§
Required Methods§
Sourcefn from_usize(value: usize) -> Option<Self>
fn from_usize(value: usize) -> Option<Self>
Convert a usize value to this offset type.
Returns None if the value is too large to be represented by this offset type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.