pub struct Ref<T: EdgedbObject> {
    pub id: Uuid,
    pub known_value: Option<T>,
}
Expand description

Basically a Uuid and an Option<T>. Use this instead of adding id: Uuid field to your structs.

Fields§

§id: Uuid§known_value: Option<T>

Trait Implementations§

source§

impl<T: Debug + EdgedbObject> Debug for Ref<T>

source§

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

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

impl<T: EdgedbComposableSelector + EdgedbObject> EdgedbComposableSelector for Ref<T>

source§

const RESULT_TYPE: ComposableQueryResultKind = ComposableQueryResultKind::Selector

source§

fn format_selector(fmt: &mut impl Write) -> Result<(), Error>

should’t add { and } around the selector
source§

fn format_subquery(fmt: &mut impl Write) -> Result<(), Error>

source§

impl<T: EdgedbObject> EdgedbValue for Ref<T>

§

type NativeArgType = Value

use Value by default
source§

fn from_edgedb_value(value: Value) -> Result<Self>

source§

impl<T: PartialEq + EdgedbObject> PartialEq for Ref<T>

source§

fn eq(&self, other: &Ref<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Eq + EdgedbObject> Eq for Ref<T>

source§

impl<T: EdgedbObject> StructuralEq for Ref<T>

source§

impl<T: EdgedbObject> StructuralPartialEq for Ref<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Ref<T>
where T: RefUnwindSafe,

§

impl<T> Send for Ref<T>
where T: Send,

§

impl<T> Sync for Ref<T>
where T: Sync,

§

impl<T> Unpin for Ref<T>
where T: Unpin,

§

impl<T> UnwindSafe for Ref<T>
where T: UnwindSafe,

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> EdgedbSetValue for T
where T: EdgedbValue,

source§

const EXPECTED_CARDINALITY: Cardinality = const EXPECTED_CARDINALITY: edgedb_protocol::server_message::Cardinality = edgedb_protocol::server_message::Cardinality::One;

source§

async fn query_direct<Args>( client: &Client, q: &str, args: Args ) -> Result<T, Error>
where Args: EdgedbQueryArgs + Send,

source§

fn from_edgedb_set_value(value: Value) -> Result<T, Error>

source§

fn interpret_possibly_missing_required_value(val: Option<T>) -> Result<T, Error>

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

§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V