pub trait CellEncoding:
Copy
+ Debug
+ Default
+ Zero
+ One
+ PartialEq {
// Required methods
fn cell_type() -> CellType;
fn into_cell_value(self) -> CellValue;
// Provided method
fn static_cast<T: CellEncoding + Sized>(value: T) -> Option<Self> { ... }
}Expand description
Trait for marking Rust primitives as having a corresponding CellType.
For example, f64 is CellEncoding through CellType::Float64,
but isize is not CellEncoding.
Required Methods§
Sourcefn into_cell_value(self) -> CellValue
fn into_cell_value(self) -> CellValue
Converts self into a CellValue.
Provided Methods§
Sourcefn static_cast<T: CellEncoding + Sized>(value: T) -> Option<Self>
fn static_cast<T: CellEncoding + Sized>(value: T) -> Option<Self>
Convert dynamic type to static type when logically known.
Returns None if given value isn’t actually the exact same
type as encoding.
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.