Struct paladin::queue::in_memory::InMemoryQueue
source · pub struct InMemoryQueue { /* private fields */ }Expand description
An in-memory implementation of Queue.
use paladin::queue::{Queue, in_memory::InMemoryQueue};
use paladin::serializer::Serializer;
use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
let queue = InMemoryQueue::new(Serializer::Cbor);
let connection = queue.get_connection().await?;
Ok(())
}Implementations§
source§impl InMemoryQueue
impl InMemoryQueue
sourcepub fn new(serializer: Serializer) -> Self
pub fn new(serializer: Serializer) -> Self
Create a new in-memory queue.
Trait Implementations§
source§impl Queue for InMemoryQueue
impl Queue for InMemoryQueue
§type Connection = InMemoryConnection
type Connection = InMemoryConnection
The type of connection used to interact with the queue.
Cloning operations should use a resource pool or connection manager to
ensure cloning is cheap.
source§fn get_connection<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_connection<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Connection>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Establish a connection to the queue.
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryQueue
impl Send for InMemoryQueue
impl Sync for InMemoryQueue
impl Unpin for InMemoryQueue
impl !UnwindSafe for InMemoryQueue
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