pub struct DatabaseQuery<'world, 'state, Q: DBQueryInfo<DbResource>, DbResource: DatabaseResource> { /* private fields */ }
Implementations§
Source§impl<'w, 's, Q: DBQueryInfo<DbResource>, DbResource: DatabaseResource> DatabaseQuery<'w, 's, Q, DbResource>
impl<'w, 's, Q: DBQueryInfo<DbResource>, DbResource: DatabaseResource> DatabaseQuery<'w, 's, Q, DbResource>
pub async fn get<D: DatabaseEntityWithRequest>( &self, db_entity: &D, ) -> Result<Q::ReadOnlyItem<'w>, ()>
pub async fn get_mut<D: DatabaseEntityWithRequest>( &self, db_entity: &D, ) -> Result<Q::Item<'w>, ()>
pub async fn update_component( &self, db_entity: &DatabaseEntity, component: Q::ReadOnlyItem<'w>, ) -> Result<(), ()>
pub async fn insert_component( &self, db_entity: &DatabaseEntity, component: Q::ReadOnlyItem<'w>, ) -> Result<(), ()>
pub async fn load_components<R: ReturnSelector<'w>, CDQ>( &self, request: RequestId, get_comp_from_db: CDQ, ) -> Result<Vec<<R as ReturnSelector<'w>>::ReturnItem>, ()>
pub async fn create( &self, component: Q::DerefItem, request: RequestId, ) -> Result<(), ()>
pub async fn update_or_insert_component(&self, entity: Entity) -> Result<(), ()>
pub fn commit(&self, request: RequestId) -> Result<(), ()>
Trait Implementations§
Source§impl<'w, 's, I, DbResource: DatabaseResource> SystemParam for DatabaseQuery<'w, 's, I, DbResource>where
I: DBQueryInfo<DbResource> + 'static,
impl<'w, 's, I, DbResource: DatabaseResource> SystemParam for DatabaseQuery<'w, 's, I, DbResource>where
I: DBQueryInfo<DbResource> + 'static,
Source§type State = QueryFetchState<'static, 'static, DbResource>
type State = QueryFetchState<'static, 'static, DbResource>
Used to store data which persists across invocations of a system.
Source§type Item<'world, 'state> = DatabaseQuery<'world, 'state, I, DbResource>
type Item<'world, 'state> = DatabaseQuery<'world, 'state, I, DbResource>
The item type returned when constructing this system param.
The value of this associated type should be
Self
, instantiated with new lifetimes. Read moreSource§fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
Registers any
World
access used by this SystemParam
and creates a new instance of this param’s State
.Source§unsafe fn get_param<'w2, 's2>(
state: &'s2 mut Self::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'w2>,
change_tick: Tick,
) -> Self::Item<'w2, 's2>
unsafe fn get_param<'w2, 's2>( state: &'s2 mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w2>, change_tick: Tick, ) -> Self::Item<'w2, 's2>
Creates a parameter to be passed into a
SystemParamFunction
. Read moreSource§fn new_archetype(
_state: &mut Self::State,
_archetype: &Archetype,
_system_meta: &mut SystemMeta,
)
fn new_archetype( _state: &mut Self::State, _archetype: &Archetype, _system_meta: &mut SystemMeta, )
For the specified
Archetype
, registers the components accessed by this SystemParam
(if applicable).Source§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
Applies any deferred mutations stored in this
SystemParam
’s state.
This is used to apply Commands
during apply_deferred
.Auto Trait Implementations§
impl<'world, 'state, Q, DbResource> Freeze for DatabaseQuery<'world, 'state, Q, DbResource>
impl<'world, 'state, Q, DbResource> !RefUnwindSafe for DatabaseQuery<'world, 'state, Q, DbResource>
impl<'world, 'state, Q, DbResource> Send for DatabaseQuery<'world, 'state, Q, DbResource>where
Q: Send,
impl<'world, 'state, Q, DbResource> Sync for DatabaseQuery<'world, 'state, Q, DbResource>where
Q: Sync,
impl<'world, 'state, Q, DbResource> Unpin for DatabaseQuery<'world, 'state, Q, DbResource>where
Q: Unpin,
impl<'world, 'state, Q, DbResource> !UnwindSafe for DatabaseQuery<'world, 'state, Q, DbResource>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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