pub trait Basis {
type Isize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin;
type Usize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin;
type FromNativeError: Debug;
type ToNativeError: Debug;
fn from_native_isize(
value: isize
) -> Result<Self::Isize, Self::FromNativeError>;
fn to_native_isize(value: Self::Isize) -> Result<isize, Self::ToNativeError>;
fn from_native_usize(
value: usize
) -> Result<Self::Usize, Self::FromNativeError>;
fn to_native_usize(value: Self::Usize) -> Result<usize, Self::ToNativeError>;
}
Expand description
A selection of types to use in place of isize
and usize
.
Required Associated Types
sourcetype Isize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin
type Isize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin
The type to use in place of isize
.
sourcetype Usize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin
type Usize: Copy + DropRaw + Send + Sync + Ord + Hash + Unpin
The type to use in place of usize
.
sourcetype FromNativeError: Debug
type FromNativeError: Debug
An error occurred during type conversion from a native isize
or
usize
.
sourcetype ToNativeError: Debug
type ToNativeError: Debug
An error occurred during type conversion to a native isize
or usize
.
Required Methods
sourcefn from_native_isize(value: isize) -> Result<Self::Isize, Self::FromNativeError>
fn from_native_isize(value: isize) -> Result<Self::Isize, Self::FromNativeError>
Returns the Isize
corresponding to the given isize
, or Err
if the
conversion fails.
sourcefn to_native_isize(value: Self::Isize) -> Result<isize, Self::ToNativeError>
fn to_native_isize(value: Self::Isize) -> Result<isize, Self::ToNativeError>
Returns the isize
corresponding to the given Isize
, or Err
if the
conversion fails.
sourcefn from_native_usize(value: usize) -> Result<Self::Usize, Self::FromNativeError>
fn from_native_usize(value: usize) -> Result<Self::Usize, Self::FromNativeError>
Returns the Usize
corresponding to the given usize
, or Err
if the
conversion fails.
sourcefn to_native_usize(value: Self::Usize) -> Result<usize, Self::ToNativeError>
fn to_native_usize(value: Self::Usize) -> Result<usize, Self::ToNativeError>
Returns the usize
corresponding to the given Usize
, or Err
if the
conversion fails.