pub trait Element:
Copy
+ Send
+ Sync
+ 'static
+ Item {
const FILL: Self;
const DTYPE: DType;
// Required methods
fn of(view: View<'_>) -> Option<&[Self]>;
fn of_mut(buffer: &mut Buffer) -> Option<&mut [Self]>;
fn view(items: &[Self]) -> View<'_>;
fn buffer(data: Vec<Self>) -> Buffer;
fn vec(buffer: Buffer) -> Option<Vec<Self>>;
fn vec_mut(buffer: &mut Buffer) -> Option<&mut Vec<Self>>;
fn truth(b: bool) -> Self;
}Expand description
An element type of compact buffers: bool, the integer widths u8, i16, i32 and i64, the float widths half::f16, f32 and f64, Complex32 and Complex64, and char.
Required Associated Constants§
Required Methods§
Sourcefn of_mut(buffer: &mut Buffer) -> Option<&mut [Self]>
fn of_mut(buffer: &mut Buffer) -> Option<&mut [Self]>
The writable items of buffer, when they have this type. The allocation and length don’t change.
Sourcefn vec(buffer: Buffer) -> Option<Vec<Self>>
fn vec(buffer: Buffer) -> Option<Vec<Self>>
The items of buffer, moved out, when they have this type.
Sourcefn vec_mut(buffer: &mut Buffer) -> Option<&mut Vec<Self>>
fn vec_mut(buffer: &mut Buffer) -> Option<&mut Vec<Self>>
The items of buffer as their vector, when they have this type, for a writer that appends or clears them.
Sourcefn truth(b: bool) -> Self
fn truth(b: bool) -> Self
b as an item of this type: 1 or 0 for a number, the Boolean itself, or the characters U+0001 and U+0000. A Boolean mask becomes lanes of the items that a kernel such as Choose chooses between. A number converts through an integer, which suits stored Booleans. A comparison’s lane mask turns into 1 or 0 faster by a choice between the two, so Indicator writes its own (tolerant::indicated).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".