pub struct PostgresBucket { /* private fields */ }Implementations§
Source§impl PostgresBucket
impl PostgresBucket
pub fn event_table(&self) -> String
Sourcepub fn last_spilled_predicate(&self) -> Option<Predicate>
pub fn last_spilled_predicate(&self) -> Option<Predicate>
Returns the last predicate that spilled to post-filtering (debug builds only).
Use this in tests to verify queries are fully pushed down to PostgreSQL:
ⓘ
let spilled = bucket.last_spilled_predicate();
assert!(spilled.is_none(), "Expected full pushdown, but got spill: {:?}", spilled);Sourcepub async fn rebuild_columns_cache(
&self,
client: &mut Client,
) -> Result<(), StateError>
pub async fn rebuild_columns_cache( &self, client: &mut Client, ) -> Result<(), StateError>
Rebuild the cache of columns in the table.
pub fn existing_columns(&self) -> Vec<String>
pub fn column(&self, column_name: &String) -> Option<PostgresColumn>
pub fn has_column(&self, column_name: &String) -> bool
pub async fn create_event_table( &self, client: &mut Client, ) -> Result<(), StateError>
pub async fn create_state_table( &self, client: &mut Client, ) -> Result<(), StateError>
pub async fn add_missing_columns( &self, client: &mut Client, missing: Vec<(String, &'static str)>, ) -> Result<(), StateError>
Trait Implementations§
Source§impl StorageCollection for PostgresBucket
impl StorageCollection for PostgresBucket
fn set_state<'life0, 'async_trait>(
&'life0 self,
state: Attested<EntityState>,
) -> Pin<Box<dyn Future<Output = Result<bool, MutationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_state<'life0, 'async_trait>(
&'life0 self,
id: EntityId,
) -> Pin<Box<dyn Future<Output = Result<Attested<EntityState>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_states<'life0, 'life1, 'async_trait>(
&'life0 self,
selection: &'life1 Selection,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<EntityState>>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_event<'life0, 'life1, 'async_trait>(
&'life0 self,
entity_event: &'life1 Attested<Event>,
) -> Pin<Box<dyn Future<Output = Result<bool, MutationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_events<'life0, 'async_trait>(
&'life0 self,
event_ids: Vec<EventId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<Event>>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_events<'life0, 'async_trait>(
&'life0 self,
event_ids: Vec<EventId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<Event>>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve a list of events
Source§fn dump_entity_events<'life0, 'async_trait>(
&'life0 self,
entity_id: EntityId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<Event>>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dump_entity_events<'life0, 'async_trait>(
&'life0 self,
entity_id: EntityId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<Event>>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve all events from the collection
fn set_states<'life0, 'async_trait>(
&'life0 self,
states: Vec<Attested<EntityState>>,
) -> Pin<Box<dyn Future<Output = Result<(), MutationError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_states<'life0, 'async_trait>(
&'life0 self,
ids: Vec<EntityId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attested<EntityState>>, RetrievalError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for PostgresBucket
impl !RefUnwindSafe for PostgresBucket
impl Send for PostgresBucket
impl Sync for PostgresBucket
impl Unpin for PostgresBucket
impl UnsafeUnpin for PostgresBucket
impl !UnwindSafe for PostgresBucket
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> 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 moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.