pub struct CopyOptimization<T, U>(/* private fields */)
where
T: ?Sized,
U: ?Sized;Expand description
An optimization hint about whether the conversion from T to U is equivalent to copying the
raw bytes of T.
Implementations§
Source§impl<T, U> CopyOptimization<T, U>
impl<T, U> CopyOptimization<T, U>
Sourcepub const unsafe fn enable() -> CopyOptimization<T, U>
pub const unsafe fn enable() -> CopyOptimization<T, U>
Returns a CopyOptimization hint with the optimization enabled.
§Safety
T and U must be the same size and must not have any uninit bytes (e.g. padding).
Sourcepub const unsafe fn enable_if(value: bool) -> CopyOptimization<T, U>
pub const unsafe fn enable_if(value: bool) -> CopyOptimization<T, U>
Returns a CopyOptimization hint with the optimization enabled if value is true.
§Safety
T and U must be the same size and must not have any uninit bytes (e.g. padding) if
value is true.
Sourcepub const fn disable() -> CopyOptimization<T, U>
pub const fn disable() -> CopyOptimization<T, U>
Returns a CopyOptimization hint with the optimization disabled.
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Returns whether the optimization is enabled.
Sourcepub const fn infer_array<const N: usize>(
&self,
) -> CopyOptimization<[T; N], [U; N]>
pub const fn infer_array<const N: usize>( &self, ) -> CopyOptimization<[T; N], [U; N]>
Infers whether the conversion from [T; N] to [U; N] is copy-optimizable based on the
conversion from T to U.
Sourcepub const fn infer_slice(&self) -> CopyOptimization<[T], [U]>
pub const fn infer_slice(&self) -> CopyOptimization<[T], [U]>
Infers whether the conversion from [T] to [U] is copy-optimizable based on the
conversion from T to U.
Source§impl<T> CopyOptimization<T, T>where
T: ?Sized,
impl<T> CopyOptimization<T, T>where
T: ?Sized,
Sourcepub const fn identity() -> CopyOptimization<T, T>
pub const fn identity() -> CopyOptimization<T, T>
Returns an enabled CopyOptimization, as copy optimization is always enabled from a type to
itself.
Source§impl CopyOptimization<(), ()>
impl CopyOptimization<(), ()>
Sourcepub const PRIMITIVE: CopyOptimization<(), ()>
pub const PRIMITIVE: CopyOptimization<(), ()>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<u8, u8>
impl CopyOptimization<u8, u8>
Sourcepub const PRIMITIVE: CopyOptimization<u8, u8>
pub const PRIMITIVE: CopyOptimization<u8, u8>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<i8, i8>
impl CopyOptimization<i8, i8>
Sourcepub const PRIMITIVE: CopyOptimization<i8, i8>
pub const PRIMITIVE: CopyOptimization<i8, i8>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<bool, bool>
impl CopyOptimization<bool, bool>
Sourcepub const PRIMITIVE: CopyOptimization<bool, bool>
pub const PRIMITIVE: CopyOptimization<bool, bool>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int16, Int16>
impl CopyOptimization<Int16, Int16>
Sourcepub const PRIMITIVE: CopyOptimization<Int16, Int16>
pub const PRIMITIVE: CopyOptimization<Int16, Int16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<i16, Int16>
impl CopyOptimization<i16, Int16>
Sourcepub const PRIMITIVE: CopyOptimization<i16, Int16>
pub const PRIMITIVE: CopyOptimization<i16, Int16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int16, i16>
impl CopyOptimization<Int16, i16>
Sourcepub const PRIMITIVE: CopyOptimization<Int16, i16>
pub const PRIMITIVE: CopyOptimization<Int16, i16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int32, Int32>
impl CopyOptimization<Int32, Int32>
Sourcepub const PRIMITIVE: CopyOptimization<Int32, Int32>
pub const PRIMITIVE: CopyOptimization<Int32, Int32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<i32, Int32>
impl CopyOptimization<i32, Int32>
Sourcepub const PRIMITIVE: CopyOptimization<i32, Int32>
pub const PRIMITIVE: CopyOptimization<i32, Int32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int32, i32>
impl CopyOptimization<Int32, i32>
Sourcepub const PRIMITIVE: CopyOptimization<Int32, i32>
pub const PRIMITIVE: CopyOptimization<Int32, i32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int64, Int64>
impl CopyOptimization<Int64, Int64>
Sourcepub const PRIMITIVE: CopyOptimization<Int64, Int64>
pub const PRIMITIVE: CopyOptimization<Int64, Int64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<i64, Int64>
impl CopyOptimization<i64, Int64>
Sourcepub const PRIMITIVE: CopyOptimization<i64, Int64>
pub const PRIMITIVE: CopyOptimization<i64, Int64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Int64, i64>
impl CopyOptimization<Int64, i64>
Sourcepub const PRIMITIVE: CopyOptimization<Int64, i64>
pub const PRIMITIVE: CopyOptimization<Int64, i64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint16, Uint16>
impl CopyOptimization<Uint16, Uint16>
Sourcepub const PRIMITIVE: CopyOptimization<Uint16, Uint16>
pub const PRIMITIVE: CopyOptimization<Uint16, Uint16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<u16, Uint16>
impl CopyOptimization<u16, Uint16>
Sourcepub const PRIMITIVE: CopyOptimization<u16, Uint16>
pub const PRIMITIVE: CopyOptimization<u16, Uint16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint16, u16>
impl CopyOptimization<Uint16, u16>
Sourcepub const PRIMITIVE: CopyOptimization<Uint16, u16>
pub const PRIMITIVE: CopyOptimization<Uint16, u16>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint32, Uint32>
impl CopyOptimization<Uint32, Uint32>
Sourcepub const PRIMITIVE: CopyOptimization<Uint32, Uint32>
pub const PRIMITIVE: CopyOptimization<Uint32, Uint32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<u32, Uint32>
impl CopyOptimization<u32, Uint32>
Sourcepub const PRIMITIVE: CopyOptimization<u32, Uint32>
pub const PRIMITIVE: CopyOptimization<u32, Uint32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint32, u32>
impl CopyOptimization<Uint32, u32>
Sourcepub const PRIMITIVE: CopyOptimization<Uint32, u32>
pub const PRIMITIVE: CopyOptimization<Uint32, u32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint64, Uint64>
impl CopyOptimization<Uint64, Uint64>
Sourcepub const PRIMITIVE: CopyOptimization<Uint64, Uint64>
pub const PRIMITIVE: CopyOptimization<Uint64, Uint64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<u64, Uint64>
impl CopyOptimization<u64, Uint64>
Sourcepub const PRIMITIVE: CopyOptimization<u64, Uint64>
pub const PRIMITIVE: CopyOptimization<u64, Uint64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Uint64, u64>
impl CopyOptimization<Uint64, u64>
Sourcepub const PRIMITIVE: CopyOptimization<Uint64, u64>
pub const PRIMITIVE: CopyOptimization<Uint64, u64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Float32, Float32>
impl CopyOptimization<Float32, Float32>
Sourcepub const PRIMITIVE: CopyOptimization<Float32, Float32>
pub const PRIMITIVE: CopyOptimization<Float32, Float32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<f32, Float32>
impl CopyOptimization<f32, Float32>
Sourcepub const PRIMITIVE: CopyOptimization<f32, Float32>
pub const PRIMITIVE: CopyOptimization<f32, Float32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Float32, f32>
impl CopyOptimization<Float32, f32>
Sourcepub const PRIMITIVE: CopyOptimization<Float32, f32>
pub const PRIMITIVE: CopyOptimization<Float32, f32>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Float64, Float64>
impl CopyOptimization<Float64, Float64>
Sourcepub const PRIMITIVE: CopyOptimization<Float64, Float64>
pub const PRIMITIVE: CopyOptimization<Float64, Float64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<f64, Float64>
impl CopyOptimization<f64, Float64>
Sourcepub const PRIMITIVE: CopyOptimization<f64, Float64>
pub const PRIMITIVE: CopyOptimization<f64, Float64>
Whether copy optimization between the two primitive types is enabled.
Source§impl CopyOptimization<Float64, f64>
impl CopyOptimization<Float64, f64>
Sourcepub const PRIMITIVE: CopyOptimization<Float64, f64>
pub const PRIMITIVE: CopyOptimization<Float64, f64>
Whether copy optimization between the two primitive types is enabled.
Auto Trait Implementations§
impl<T, U> Freeze for CopyOptimization<T, U>
impl<T, U> RefUnwindSafe for CopyOptimization<T, U>
impl<T, U> !Send for CopyOptimization<T, U>
impl<T, U> !Sync for CopyOptimization<T, U>
impl<T, U> Unpin for CopyOptimization<T, U>
impl<T, U> UnsafeUnpin for CopyOptimization<T, U>
impl<T, U> UnwindSafe for CopyOptimization<T, U>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self