Skip to main content

Cpu

Struct Cpu 

Source
pub struct Cpu;
Expand description

The CPU device: a zero-sized type tag. All ops are associated functions.

Trait Implementations§

Source§

impl BoolOps<Cpu> for Cpu

Source§

fn b_falses( shape: &Shape, _device: &Cpu, _dtype: BoolDType, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_trues( shape: &Shape, _device: &Cpu, _dtype: BoolDType, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_from_bool<'a>( data: impl Into<Cow<'a, [bool]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_from_bytes<'a>( bytes: impl Into<Cow<'a, [u8]>>, _shape: &Shape, _device: &Cpu, _dtype: BoolDType, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_contiguous( x: &<Cpu as Device>::BoolStorage, l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_cast_float( x: &CpuBoolStorage, layout: &Layout, to: FloatDType, ) -> Result<CpuFloatStorage>

Source§

fn b_cast_int( x: &CpuBoolStorage, layout: &Layout, to: IntDType, ) -> Result<CpuIntStorage>

Source§

fn b_cast_bool( x: &CpuBoolStorage, layout: &Layout, _to: BoolDType, ) -> Result<CpuBoolStorage>

Source§

fn b_to_vec( x: &<Cpu as Device>::BoolStorage, layout: &Layout, ) -> Result<Vec<bool>>

Read all elements into a Vec<bool> in logical (layout) order.
Source§

fn b_to_bytes<'a>( x: &'a <Cpu as Device>::BoolStorage, layout: &Layout, ) -> Result<Cow<'a, [u8]>>

Read raw bytes (0/1 per element) in logical (layout) order. Returns Cow::Borrowed when the underlying storage is already contiguous (zero-copy); Cow::Owned otherwise.
Source§

fn b_and( lhs: &<Cpu as Device>::BoolStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::BoolStorage, rhs_l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_or( lhs: &<Cpu as Device>::BoolStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::BoolStorage, rhs_l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_xor( lhs: &<Cpu as Device>::BoolStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::BoolStorage, rhs_l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_not( x: &<Cpu as Device>::BoolStorage, l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_reduce_all( x: &<Cpu as Device>::BoolStorage, l: &Layout, dims: &[usize], keepdim: bool, ) -> Result<(<Cpu as Device>::BoolStorage, Shape)>

Source§

fn b_reduce_any( x: &<Cpu as Device>::BoolStorage, l: &Layout, dims: &[usize], keepdim: bool, ) -> Result<(<Cpu as Device>::BoolStorage, Shape)>

Source§

fn b_true_count(x: &<Cpu as Device>::BoolStorage, l: &Layout) -> Result<usize>

Source§

fn b_cat( srcs: &[(&<Cpu as Device>::BoolStorage, &Layout)], dim: usize, ) -> Result<(<Cpu as Device>::BoolStorage, Shape)>

Source§

fn b_pick( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::BoolStorage, true_l: &Layout, on_false: &<Cpu as Device>::BoolStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_pick_true( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, value: bool, on_false: &<Cpu as Device>::BoolStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_pick_false( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::BoolStorage, true_l: &Layout, value: bool, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn b_allclose( a: &CpuBoolStorage, a_l: &Layout, b: &CpuBoolStorage, b_l: &Layout, ) -> Result<bool>

Source§

fn b_view( _src: &D::BoolStorage, _src_l: &Layout, _dst_l: &Layout, _view: ViewOp, ) -> Result<Option<D::BoolStorage>>

Produce the storage for a view of src under dst_l. See [FloatOps::f_view].
Source§

impl Clone for Cpu

Source§

fn clone(&self) -> Cpu

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Cpu

Source§

impl Debug for Cpu

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Cpu

Source§

fn default() -> Cpu

Returns the “default value” for a type. Read more
Source§

impl Device for Cpu

Source§

type FloatStorage = CpuFloatStorage

Source§

type IntStorage = CpuIntStorage

Source§

type BoolStorage = CpuBoolStorage

Source§

fn name(&self) -> String

Source§

fn same_device(&self, _other: &Self) -> bool

Whether two handles refer to the same underlying device. Read more
Source§

impl Eq for Cpu

Source§

impl FloatOps<Cpu> for Cpu

Source§

fn f_zeros( shape: &Shape, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_ones( shape: &Shape, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_full( shape: &Shape, value: f64, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_from_f64<'a>( data: impl Into<Cow<'a, [f64]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_from_f32<'a>( data: impl Into<Cow<'a, [f32]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_from_bytes<'a>( bytes: impl Into<Cow<'a, [u8]>>, _shape: &Shape, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_rand_uniform( shape: &Shape, lo: f64, hi: f64, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_rand_normal( shape: &Shape, mean: f64, std: f64, _device: &Cpu, dtype: FloatDType, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_contiguous( x: &<Cpu as Device>::FloatStorage, l: &Layout, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_cast_float( x: &CpuFloatStorage, layout: &Layout, to: FloatDType, ) -> Result<CpuFloatStorage>

Source§

fn f_cast_int( x: &CpuFloatStorage, layout: &Layout, to: IntDType, ) -> Result<CpuIntStorage>

Source§

fn f_cast_bool( x: &CpuFloatStorage, layout: &Layout, _to: BoolDType, ) -> Result<CpuBoolStorage>

Source§

fn f_to_vec( x: &<Cpu as Device>::FloatStorage, layout: &Layout, ) -> Result<Vec<f64>>

Read all elements into a Vec<f64> in logical (layout) order.
Source§

fn f_to_bytes<'a>( x: &'a <Cpu as Device>::FloatStorage, layout: &Layout, ) -> Result<Cow<'a, [u8]>>

Read raw little-endian bytes in logical (layout) order. Returns Cow::Borrowed when the underlying storage is already contiguous (zero-copy); Cow::Owned otherwise.
Source§

fn f_binary( lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::FloatStorage, rhs_l: &Layout, op: BinaryOp, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_binary_scalar( lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: f64, op: BinaryOp, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_binary_scalar_( dst: &mut <Cpu as Device>::FloatStorage, dst_l: &Layout, rhs: f64, op: BinaryOp, ) -> Result<()>

Source§

fn f_binary_scalar_lhs( scalar: f64, rhs: &CpuFloatStorage, rhs_l: &Layout, op: BinaryOp, ) -> Result<CpuFloatStorage>

Source§

fn f_unary( x: &<Cpu as Device>::FloatStorage, l: &Layout, op: UnaryOp<f64>, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_float_unary( x: &<Cpu as Device>::FloatStorage, l: &Layout, op: FloatUnaryOp, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_unary_( dst: &mut <Cpu as Device>::FloatStorage, dst_l: &Layout, op: UnaryOp<f64>, ) -> Result<()>

Source§

fn f_float_unary_( dst: &mut <Cpu as Device>::FloatStorage, dst_l: &Layout, op: FloatUnaryOp, ) -> Result<()>

Source§

fn f_cmp( lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::FloatStorage, rhs_l: &Layout, op: CmpOp, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn f_cmp_scalar( lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: f64, op: CmpOp, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn f_reduce( x: &<Cpu as Device>::FloatStorage, l: &Layout, dims: &[usize], keepdim: bool, op: ReduceOp, ) -> Result<(<Cpu as Device>::FloatStorage, Shape)>

Source§

fn f_arg_reduce( x: &<Cpu as Device>::FloatStorage, l: &Layout, dim: usize, keepdim: bool, take_max: bool, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn f_matmul( lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::FloatStorage, rhs_l: &Layout, ) -> Result<(<Cpu as Device>::FloatStorage, Shape)>

Source§

fn f_add_matmul_( dst: &mut <Cpu as Device>::FloatStorage, dst_l: &Layout, lhs: &<Cpu as Device>::FloatStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::FloatStorage, rhs_l: &Layout, ) -> Result<()>

Source§

fn f_binary_( dst: &mut <Cpu as Device>::FloatStorage, dst_l: &Layout, src: &<Cpu as Device>::FloatStorage, src_l: &Layout, op: BinaryOp, ) -> Result<()>

Source§

fn f_index_select( x: &<Cpu as Device>::FloatStorage, x_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, dim: usize, ) -> Result<(<Cpu as Device>::FloatStorage, Shape)>

Source§

fn f_gather( x: &<Cpu as Device>::FloatStorage, x_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, dim: usize, ) -> Result<(<Cpu as Device>::FloatStorage, Shape)>

Source§

fn f_index_add( init: &<Cpu as Device>::FloatStorage, init_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, src: &<Cpu as Device>::FloatStorage, _src_l: &Layout, dim: usize, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_scatter_add( init: &<Cpu as Device>::FloatStorage, init_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, src: &<Cpu as Device>::FloatStorage, _src_l: &Layout, dim: usize, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_cat( srcs: &[(&<Cpu as Device>::FloatStorage, &Layout)], dim: usize, ) -> Result<(<Cpu as Device>::FloatStorage, Shape)>

Source§

fn f_softmax( x: &<Cpu as Device>::FloatStorage, l: &Layout, dim: usize, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_rms_norm( x: &<Cpu as Device>::FloatStorage, x_l: &Layout, weight: &<Cpu as Device>::FloatStorage, weight_l: &Layout, eps: f64, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_pick( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::FloatStorage, true_l: &Layout, on_false: &<Cpu as Device>::FloatStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_pick_true( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, value: f64, on_false: &<Cpu as Device>::FloatStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_pick_false( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::FloatStorage, true_l: &Layout, value: f64, ) -> Result<<Cpu as Device>::FloatStorage>

Source§

fn f_allclose( a: &CpuFloatStorage, a_l: &Layout, b: &CpuFloatStorage, b_l: &Layout, rtol: f64, atol: f64, ) -> Result<bool>

Source§

fn f_view( _src: &D::FloatStorage, _src_l: &Layout, _dst_l: &Layout, _view: ViewOp, ) -> Result<Option<D::FloatStorage>>

Source§

impl IntOps<Cpu> for Cpu

Source§

fn i_zeros( shape: &Shape, _device: &Cpu, dtype: IntDType, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_ones( shape: &Shape, _device: &Cpu, dtype: IntDType, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_full( shape: &Shape, value: i64, _device: &Cpu, dtype: IntDType, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_from_i64<'a>( data: impl Into<Cow<'a, [i64]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_from_i32<'a>( data: impl Into<Cow<'a, [i32]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_from_u32<'a>( data: impl Into<Cow<'a, [u32]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_from_u8<'a>( data: impl Into<Cow<'a, [u8]>>, _device: &Cpu, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_from_bytes<'a>( bytes: impl Into<Cow<'a, [u8]>>, _shape: &Shape, _device: &Cpu, dtype: IntDType, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_arange( start: i64, end: i64, step: i64, _device: &Cpu, dtype: IntDType, ) -> Result<(<Cpu as Device>::IntStorage, usize)>

Source§

fn i_contiguous( x: &<Cpu as Device>::IntStorage, l: &Layout, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_cast_float( x: &CpuIntStorage, layout: &Layout, to: FloatDType, ) -> Result<CpuFloatStorage>

Source§

fn i_cast_int( x: &CpuIntStorage, layout: &Layout, to: IntDType, ) -> Result<CpuIntStorage>

Source§

fn i_cast_bool( x: &CpuIntStorage, layout: &Layout, _to: BoolDType, ) -> Result<CpuBoolStorage>

Source§

fn i_to_vec( x: &<Cpu as Device>::IntStorage, layout: &Layout, ) -> Result<Vec<i64>>

Read all elements into a Vec<i64> in logical (layout) order.
Source§

fn i_to_bytes<'a>( x: &'a <Cpu as Device>::IntStorage, layout: &Layout, ) -> Result<Cow<'a, [u8]>>

Read raw little-endian bytes in logical (layout) order. Returns Cow::Borrowed when the underlying storage is already contiguous (zero-copy); Cow::Owned otherwise.
Source§

fn i_binary( lhs: &<Cpu as Device>::IntStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::IntStorage, rhs_l: &Layout, op: BinaryOp, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_binary_scalar( lhs: &<Cpu as Device>::IntStorage, lhs_l: &Layout, rhs: i64, op: BinaryOp, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_binary_( dst: &mut <Cpu as Device>::IntStorage, dst_l: &Layout, src: &<Cpu as Device>::IntStorage, src_l: &Layout, op: BinaryOp, ) -> Result<()>

Source§

fn i_binary_scalar_( dst: &mut <Cpu as Device>::IntStorage, dst_l: &Layout, rhs: i64, op: BinaryOp, ) -> Result<()>

Source§

fn i_binary_scalar_lhs( scalar: i64, rhs: &<Cpu as Device>::IntStorage, rhs_l: &Layout, op: BinaryOp, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_unary( x: &<Cpu as Device>::IntStorage, l: &Layout, op: UnaryOp<i64>, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_unary_( dst: &mut <Cpu as Device>::IntStorage, dst_l: &Layout, op: UnaryOp<i64>, ) -> Result<()>

Source§

fn i_matmul( lhs: &<Cpu as Device>::IntStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::IntStorage, rhs_l: &Layout, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn i_cmp( lhs: &<Cpu as Device>::IntStorage, lhs_l: &Layout, rhs: &<Cpu as Device>::IntStorage, rhs_l: &Layout, op: CmpOp, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn i_cmp_scalar( lhs: &<Cpu as Device>::IntStorage, lhs_l: &Layout, rhs: i64, op: CmpOp, ) -> Result<<Cpu as Device>::BoolStorage>

Source§

fn i_reduce( x: &<Cpu as Device>::IntStorage, l: &Layout, dims: &[usize], keepdim: bool, op: ReduceOp, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn i_index_select( x: &<Cpu as Device>::IntStorage, x_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, dim: usize, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn i_gather( x: &<Cpu as Device>::IntStorage, x_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, dim: usize, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn i_cat( srcs: &[(&<Cpu as Device>::IntStorage, &Layout)], dim: usize, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

Source§

fn i_arg_reduce( x: &<Cpu as Device>::IntStorage, layout: &Layout, dim: usize, keepdim: bool, take_max: bool, ) -> Result<(<Cpu as Device>::IntStorage, Shape)>

argmin/argmax return int-kind indices.
Source§

fn i_index_add( init: &<Cpu as Device>::IntStorage, init_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, src: &<Cpu as Device>::IntStorage, _src_l: &Layout, dim: usize, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_scatter_add( init: &<Cpu as Device>::IntStorage, init_l: &Layout, idx: &<Cpu as Device>::IntStorage, idx_l: &Layout, src: &<Cpu as Device>::IntStorage, _src_l: &Layout, dim: usize, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_pick( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::IntStorage, true_l: &Layout, on_false: &<Cpu as Device>::IntStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_pick_true( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, value: i64, on_false: &<Cpu as Device>::IntStorage, false_l: &Layout, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_pick_false( mask: &<Cpu as Device>::BoolStorage, mask_l: &Layout, on_true: &<Cpu as Device>::IntStorage, true_l: &Layout, value: i64, ) -> Result<<Cpu as Device>::IntStorage>

Source§

fn i_allclose( a: &CpuIntStorage, a_l: &Layout, b: &CpuIntStorage, b_l: &Layout, ) -> Result<bool>

Source§

fn i_view( _src: &D::IntStorage, _src_l: &Layout, _dst_l: &Layout, _view: ViewOp, ) -> Result<Option<D::IntStorage>>

Produce the storage for a view of src under dst_l. See [FloatOps::f_view].
Source§

impl PartialEq for Cpu

Source§

fn eq(&self, other: &Cpu) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Storage<Cpu, Bool> for CpuBoolStorage

Source§

fn dtype(&self) -> BoolDType

Source§

fn device(&self) -> &Cpu

Source§

impl Storage<Cpu, Float> for CpuFloatStorage

Source§

fn dtype(&self) -> FloatDType

Source§

fn device(&self) -> &Cpu

Source§

impl Storage<Cpu, Int> for CpuIntStorage

Source§

fn dtype(&self) -> IntDType

Source§

fn device(&self) -> &Cpu

Source§

impl StructuralPartialEq for Cpu

Auto Trait Implementations§

§

impl Freeze for Cpu

§

impl RefUnwindSafe for Cpu

§

impl Send for Cpu

§

impl Sync for Cpu

§

impl Unpin for Cpu

§

impl UnsafeUnpin for Cpu

§

impl UnwindSafe for Cpu

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V