pub trait Element:
Copy
+ Send
+ Sync
+ PartialEq
+ PartialOrd
+ Default
+ Debug
+ 'static
+ Sealed
+ Ops
+ BufferElement {
type Real: Element;
const DTYPE: DType;
// Required methods
fn re(self) -> Self::Real;
fn im(self) -> Self::Real;
fn from_parts(re: Self::Real, im: Self::Real) -> Self;
fn to_value(self) -> Value;
fn from_value(v: Value) -> Self;
fn write_bytes(self, out: &mut Vec<u8>);
fn read_bytes(bytes: &[u8]) -> Self;
fn to_bits(self) -> u64;
fn from_bits(bits: u64) -> Self;
}Expand description
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_parts(re: Self::Real, im: Self::Real) -> Self
fn from_parts(re: Self::Real, im: Self::Real) -> Self
The complex number with the given parts (for other types than complex, the real part; the imaginary part is ignored).
Sourcefn from_value(v: Value) -> Self
fn from_value(v: Value) -> Self
Converts a value, with the semantics of XLA’s convert (see
cast).
Sourcefn write_bytes(self, out: &mut Vec<u8>)
fn write_bytes(self, out: &mut Vec<u8>)
Writes the native-endian bytes of the value.
Sourcefn read_bytes(bytes: &[u8]) -> Self
fn read_bytes(bytes: &[u8]) -> Self
Reads a value from native-endian bytes of the right length.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".