pub struct InMemoryBus { /* private fields */ }Implementations§
Source§impl InMemoryBus
impl InMemoryBus
pub fn new(config: InMemoryConfig) -> Self
Sourcepub fn new_with_deduplication_clock(
config: InMemoryConfig,
clock: impl Fn() -> Instant + Send + Sync + 'static,
) -> Self
pub fn new_with_deduplication_clock( config: InMemoryConfig, clock: impl Fn() -> Instant + Send + Sync + 'static, ) -> Self
Injects a monotonic clock for deduplication without waiting in tests. Delivery leases and work-queue delays still use the real clock. Each bus has one stream; clones share its ids, while separate buses do not.
pub fn events(&self) -> Vec<BackendEvent>
pub fn queued_bytes(&self) -> usize
pub fn inject_permission_violation(&self, subject: impl Into<String>)
Trait Implementations§
Source§impl Clone for InMemoryBus
impl Clone for InMemoryBus
Source§impl PermissionViolationSource for InMemoryBus
impl PermissionViolationSource for InMemoryBus
fn next_violation<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = BusResult<Option<AsyncPermissionViolation>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Register for InMemoryBus
impl Register for InMemoryBus
type Watch = InMemoryRegisterWatch
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = BusResult<Revision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = BusResult<RegisterValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = BusResult<Tombstone>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn watch<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = BusResult<Self::Watch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Stream for InMemoryBus
impl Stream for InMemoryBus
type Cursor = InMemoryStreamCursor
Source§fn publish<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
id: &'life2 str,
digest: ContentDigest,
headers: Headers,
) -> Pin<Box<dyn Future<Output = BusResult<PublishReceipt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn publish<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 str,
id: &'life2 str,
digest: ContentDigest,
headers: Headers,
) -> Pin<Box<dyn Future<Output = BusResult<PublishReceipt>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Publishes a message, returning whether it was stored or deduplicated. Read more
Source§fn consumer<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: DurableOwner<'life1>,
) -> Pin<Box<dyn Future<Output = BusResult<Self::Cursor>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn consumer<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: DurableOwner<'life1>,
) -> Pin<Box<dyn Future<Output = BusResult<Self::Cursor>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attaches to the owner’s durable, created separately; this client cannot
create workload consumers.
Source§impl WorkQueue for InMemoryBus
impl WorkQueue for InMemoryBus
fn claim<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BusResult<ClaimOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ack<'life0, 'async_trait>(
&'life0 self,
token: DeliveryToken,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn nak<'life0, 'async_trait>(
&'life0 self,
token: DeliveryToken,
delay: Duration,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn term<'life0, 'async_trait>(
&'life0 self,
token: DeliveryToken,
) -> Pin<Box<dyn Future<Output = BusResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryBus
impl !UnwindSafe for InMemoryBus
impl Forget for InMemoryBus
impl Freeze for InMemoryBus
impl Send for InMemoryBus
impl Sync for InMemoryBus
impl Unpin for InMemoryBus
impl UnsafeUnpin for InMemoryBus
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