pub struct RedbTicketQueue {
db: Weak<Database>,
channel_id: ChannelId,
}Expand description
Implementation of TicketQueue using redb database and postcard serializer,
associated with the RedbStore.
Fields§
§db: Weak<Database>§channel_id: ChannelIdTrait Implementations§
Source§impl TicketQueue for RedbTicketQueue
impl TicketQueue for RedbTicketQueue
type Error = RedbStoreError
Source§fn push(&mut self, ticket: RedeemableTicket) -> Result<(), Self::Error>
fn push(&mut self, ticket: RedeemableTicket) -> Result<(), Self::Error>
Add a ticket to the queue.
Source§fn pop(&mut self) -> Result<Option<RedeemableTicket>, Self::Error>
fn pop(&mut self) -> Result<Option<RedeemableTicket>, Self::Error>
Remove and return the next ticket in-order from the queue. Read more
Source§fn peek(&self) -> Result<Option<RedeemableTicket>, Self::Error>
fn peek(&self) -> Result<Option<RedeemableTicket>, Self::Error>
Return the next ticket in-order from the queue without removing it. Read more
Source§fn iter_unordered(
&self,
) -> Result<impl Iterator<Item = Result<RedeemableTicket, Self::Error>>, Self::Error>
fn iter_unordered( &self, ) -> Result<impl Iterator<Item = Result<RedeemableTicket, Self::Error>>, Self::Error>
Iterate over all tickets in the queue in arbitrary order. Read more
Auto Trait Implementations§
impl Freeze for RedbTicketQueue
impl !RefUnwindSafe for RedbTicketQueue
impl Send for RedbTicketQueue
impl Sync for RedbTicketQueue
impl Unpin for RedbTicketQueue
impl !UnwindSafe for RedbTicketQueue
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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