Enum Value

Source
pub enum Value {
    Int(i64),
    Bool(bool),
    String(String),
    Binary(Vec<u8>),
    Table(Vec<Row<'static>>),
    Timestamp(DateTime<Utc>),
    Float(f32),
    Double(f64),
    Link(Link),
    LinkList(Vec<Link>),
    BackLink(Backlink),
    None,
    // some variants omitted
}
Expand description

A single value from a Realm database. Represents one row in one column.

Variants§

§

Int(i64)

A signed integer value. Integers may be nullable in Realm, in which case they are represented as None.

§

Bool(bool)

A boolean value. Booleans may be nullable in Realm, in which case they are represented as None.

§

String(String)

A string value. Strings may be nullable in Realm, in which case they are represented as None.

§

Binary(Vec<u8>)

A binary blob value. Binary blobs may be nullable in Realm, in which case they are represented as None.

§

Table(Vec<Row<'static>>)

A subtable value. Tables in Realm may have a column that contains an entire table. In that case, upon loading the row, the subtable and all its rows are loaded.

§

Timestamp(DateTime<Utc>)

A timestamp value, represented using the chrono crate. Timestamps may be nullable in Realm, in which case they are represented as None.

§

Float(f32)

A floating-point value.

§

Double(f64)

A double-precision floating-point value.

A link to a row in a given table. If the link is null, it is represented as None.

A list of links to rows in a given table. If a row has no links, this will be an empty list.

A backlink. In cases where table A maintains a link (see Link or LinkList), table B maintains a backlink to table A. You can use this to navigate back to the parent row in a has-one relationship.

Backlinks may be nullable in Realm, in which case they are represented as None.

Backlinks are special, as their containing columns are unnamed, and thus cannot be retrieved using Row::get. Instead, you can use Row::backlinks to retrieve the backlinks. See the documentation for realm_model! for how to incorporate backlinks into your model classes.

§

None

A null value.

Implementations§

Source§

impl Value

Source

pub fn is_none(&self) -> bool

Returns true if the value is None.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

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

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

impl From<&str> for Value

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<Backlink> for Value

Source§

fn from(value: Backlink) -> Self

Converts to this type from the input type.
Source§

impl From<DateTime<Utc>> for Value

Source§

fn from(value: DateTime<Utc>) -> Self

Converts to this type from the input type.
Source§

impl From<Link> for Value

Source§

fn from(value: Link) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for Value
where T: Into<Value>,

Source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Link>> for Value

Source§

fn from(value: Vec<Link>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Row<'static>>> for Value

Source§

fn from(value: Vec<Row<'static>>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for DateTime<Utc>

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Option<DateTime<Utc>>

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Option<Link>

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Option<String>

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Option<i64>

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for String

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T> TryFrom<Value> for Vec<T>
where T: TryFrom<Row<'a>>, T::Error: Error + 'static,

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for bool

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f32

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f64

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i64

Source§

type Error = ValueError

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

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = 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>,

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more