pub enum Object<Txn> {
Class(InstanceClass),
Instance(InstanceExt<Txn, State<Txn>>),
}Expand description
A user-defined InstanceClass or InstanceExt.
Variants§
Class(InstanceClass)
Instance(InstanceExt<Txn, State<Txn>>)
Trait Implementations§
Source§impl<Txn> From<InstanceClass> for Object<Txn>
impl<Txn> From<InstanceClass> for Object<Txn>
Source§fn from(class: InstanceClass) -> Self
fn from(class: InstanceClass) -> Self
Converts to this type from the input type.
Source§impl<Txn> From<InstanceExt<Txn, State<Txn>>> for Object<Txn>
impl<Txn> From<InstanceExt<Txn, State<Txn>>> for Object<Txn>
Source§fn from(instance: InstanceExt<Txn, State<Txn>>) -> Self
fn from(instance: InstanceExt<Txn, State<Txn>>) -> Self
Converts to this type from the input type.
Source§impl<Txn> Instance for Object<Txn>
impl<Txn> Instance for Object<Txn>
Source§type Class = ObjectType
type Class = ObjectType
The
Class type of this instanceSource§fn class(&self) -> ObjectType
fn class(&self) -> ObjectType
Returns the [
Class] of this instance.Source§impl<'en, Txn> IntoView<'en, CacheBlock> for Object<Txn>
impl<'en, Txn> IntoView<'en, CacheBlock> for Object<Txn>
Source§type Txn = Txn
type Txn = Txn
The type of
Transaction which this state supportsSource§type View = ObjectView<'en>
type View = ObjectView<'en>
The type of encodable view returned by
into_viewSource§fn into_view<'async_trait>(
self,
_txn: Txn,
) -> Pin<Box<dyn Future<Output = TCResult<ObjectView<'en>>> + Send + 'async_trait>>where
Self: 'async_trait,
fn into_view<'async_trait>(
self,
_txn: Txn,
) -> Pin<Box<dyn Future<Output = TCResult<ObjectView<'en>>> + Send + 'async_trait>>where
Self: 'async_trait,
Return a
View which can be encoded with en::IntoStream.Source§impl<Txn> TryCastFrom<Object<Txn>> for Scalar
impl<Txn> TryCastFrom<Object<Txn>> for Scalar
Source§fn can_cast_from(object: &Object<Txn>) -> bool
fn can_cast_from(object: &Object<Txn>) -> bool
Test if
value can be cast into Self.Source§fn opt_cast_from(object: Object<Txn>) -> Option<Self>
fn opt_cast_from(object: Object<Txn>) -> Option<Self>
Returns
Some(Self) if the source value can be cast into Self, otherwise None.Source§impl<Txn> TryCastFrom<Object<Txn>> for Value
impl<Txn> TryCastFrom<Object<Txn>> for Value
Source§fn can_cast_from(object: &Object<Txn>) -> bool
fn can_cast_from(object: &Object<Txn>) -> bool
Test if
value can be cast into Self.Source§fn opt_cast_from(object: Object<Txn>) -> Option<Self>
fn opt_cast_from(object: Object<Txn>) -> Option<Self>
Returns
Some(Self) if the source value can be cast into Self, otherwise None.Auto Trait Implementations§
impl<Txn> Freeze for Object<Txn>
impl<Txn> RefUnwindSafe for Object<Txn>where
Txn: RefUnwindSafe,
impl<Txn> Send for Object<Txn>where
Txn: Send,
impl<Txn> Sync for Object<Txn>where
Txn: Sync,
impl<Txn> Unpin for Object<Txn>where
Txn: Unpin,
impl<Txn> UnwindSafe for Object<Txn>where
Txn: UnwindSafe + RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true if self can be cast into the target type T.Source§impl<State, T> Public<State> for T
impl<State, T> Public<State> for T
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
txn: &'life1 <State as StateInstance>::Txn,
path: &'life2 [Id],
key: Value,
) -> Pin<Box<dyn Future<Output = Result<State, TCError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
txn: &'life1 <State as StateInstance>::Txn,
path: &'life2 [Id],
key: Value,
value: State,
) -> Pin<Box<dyn Future<Output = Result<(), TCError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
txn: &'life1 <State as StateInstance>::Txn,
path: &'life2 [Id],
params: Map<State>,
) -> Pin<Box<dyn Future<Output = Result<State, TCError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
txn: &'life1 <State as StateInstance>::Txn,
path: &'life2 [Id],
key: Value,
) -> Pin<Box<dyn Future<Output = Result<(), TCError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value can be cast into Self.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self) if the source value can be cast into Self, otherwise None.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self can be cast into T.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T) if self can be cast into T, otherwise None.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T) if self can be cast into T, otherwise calls on_err.