Skip to main content

Assignable

Trait Assignable 

Source
pub trait Assignable<T: ValueType> {
    // Required method
    fn into_value(self) -> Result<PropertyValue, DbError>;
}
Expand description

A Rust value that may be assigned to a property of value type T.

This is the compile-time gate behind the typed write surface: a value implements Assignable<T> only for the T it can legally inhabit, so a type-mismatched assignment fails to compile.

§Performance

Assignable::into_value is O(1) except for text (O(value length)).

Required Methods§

Source

fn into_value(self) -> Result<PropertyValue, DbError>

Converts into a PropertyValue, checking range where narrowing.

§Errors

Returns DbError::ValueOutOfRange when an unsigned value exceeds i64::MAX.

§Performance

This function is O(1) except for text (O(value length)).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Assignable<Bool> for bool

Source§

impl Assignable<Int> for i64

Source§

impl Assignable<Int> for u64

Source§

impl Assignable<Int> for usize

Source§

impl Assignable<Text> for &str

Source§

impl Assignable<Text> for String

Implementors§