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: EdgedbComposableSelector + EdgedbObject> EdgedbComposableSelector for Ref<T>
impl<T: EdgedbComposableSelector + EdgedbObject> EdgedbComposableSelector for Ref<T>
const RESULT_TYPE: ComposableQueryResultKind = ComposableQueryResultKind::Selector
Source§fn format_selector(fmt: &mut impl Write) -> Result<(), Error>
fn format_selector(fmt: &mut impl Write) -> Result<(), Error>
should’t add
{
and }
around the selectorfn format_subquery(fmt: &mut impl Write) -> Result<(), Error>
Source§impl<T: EdgedbObject> EdgedbValue for Ref<T>
impl<T: EdgedbObject> EdgedbValue for Ref<T>
Source§type NativeArgType = Value
type NativeArgType = Value
use Value by default
fn from_edgedb_value(value: Value) -> Result<Self>
impl<T: Eq + EdgedbObject> Eq for Ref<T>
impl<T: EdgedbObject> StructuralPartialEq for Ref<T>
Auto Trait Implementations§
impl<T> Freeze for Ref<T>where
T: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> EdgedbSetValue for Twhere
T: EdgedbValue,
impl<T> EdgedbSetValue for Twhere
T: EdgedbValue,
const EXPECTED_CARDINALITY: Cardinality = const EXPECTED_CARDINALITY: edgedb_protocol::server_message::Cardinality = edgedb_protocol::server_message::Cardinality::One;
async fn query_direct<Args>(
client: &Client,
q: &str,
args: Args,
) -> Result<T, Error>where
Args: EdgedbQueryArgs + Send,
fn from_edgedb_set_value(value: Value) -> Result<T, Error>
fn interpret_possibly_missing_required_value(val: Option<T>) -> Result<T, Error>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more