pub struct CastOperation<'c> { /* private fields */ }
Expand description

A cast operation. Cast operation.

Performs a set of permissible cast operations

ModeInputOutput
signed 8 to boolint8Boolean
signed 16 to boolint16Boolean
signed 32 to boolint32Boolean
bool to 8Booleanint8
bool to 16Booleanint16
bool to 32Booleanint32
signed 8 to signed 16int8int16
signed 8 to signed 32int8int32
signed 16 to signed 8int16int8
signed 16 to signed 32int16int32
signed 32 to signed 8int32int8
signed 32 to signed 16int32int16
float to signed 8floatint8
float to signed 16floatint16
signed 8 to floatint8float
signed 16 to floatint16float
float 32 to float 64float32float64
float 64 to float 32float64float32

Implementations§

source§

impl<'c> CastOperation<'c>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> CastOperationBuilder<'c, Unset, Unset>

Creates a builder.

source

pub fn output(&self) -> Result<OperationResult<'c, '_>, Error>

source

pub fn input(&self) -> Result<Value<'c, '_>, Error>

Trait Implementations§

source§

impl<'c> From<CastOperation<'c>> for Operation<'c>

source§

fn from(operation: CastOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for CastOperation<'c>

§

type Error = Error

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

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for CastOperation<'c>

§

impl<'c> !Send for CastOperation<'c>

§

impl<'c> !Sync for CastOperation<'c>

§

impl<'c> Unpin for CastOperation<'c>

§

impl<'c> UnwindSafe for CastOperation<'c>

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> 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<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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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>,

§

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.