pub struct DbOfferStore { /* private fields */ }Implementations§
Source§impl DbOfferStore
impl DbOfferStore
pub async fn connect( uri: &str, max_connections: u32, ) -> Result<Self, OfferStoreError>
pub async fn migrate_up(&self) -> Result<(), OfferStoreError>
pub async fn migrate_down(&self) -> Result<(), OfferStoreError>
pub fn from_db(db: DatabaseConnection) -> Self
Trait Implementations§
Source§impl Clone for DbOfferStore
impl Clone for DbOfferStore
Source§fn clone(&self) -> DbOfferStore
fn clone(&self) -> DbOfferStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DbOfferStore
impl Debug for DbOfferStore
Source§impl OfferMetadataStore for DbOfferStore
impl OfferMetadataStore for DbOfferStore
type Error = OfferStoreError
fn get_metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
partition: &'life1 str,
id: &'life2 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<OfferMetadata>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_all_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: &'life1 str,
start: usize,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<OfferMetadata>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_metadata<'life0, 'async_trait>(
&'life0 self,
offer: OfferMetadata,
) -> Pin<Box<dyn Future<Output = Result<Option<Uuid>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_metadata<'life0, 'async_trait>(
&'life0 self,
offer: OfferMetadata,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
partition: &'life1 str,
id: &'life2 Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl OfferProvider for DbOfferStore
impl OfferProvider for DbOfferStore
type Error = OfferStoreError
fn offer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_hostname: &'life1 str,
partition: &'life2 str,
id: &'life3 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Offer>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§impl OfferStore for DbOfferStore
impl OfferStore for DbOfferStore
type Error = OfferStoreError
fn get_offer<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
partition: &'life1 str,
id: &'life2 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<OfferRecord>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_offers<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: &'life1 str,
start: usize,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<OfferRecord>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_offer<'life0, 'async_trait>(
&'life0 self,
offer: OfferRecord,
) -> Pin<Box<dyn Future<Output = Result<Option<Uuid>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_offer<'life0, 'async_trait>(
&'life0 self,
offer: OfferRecord,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_offer<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
partition: &'life1 str,
id: &'life2 Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for DbOfferStore
impl !RefUnwindSafe for DbOfferStore
impl Send for DbOfferStore
impl Sync for DbOfferStore
impl Unpin for DbOfferStore
impl !UnwindSafe for DbOfferStore
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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request