pub struct MemoryBackend { /* private fields */ }Expand description
Memory backend for testing
Implementations§
Source§impl MemoryBackend
impl MemoryBackend
Trait Implementations§
Source§impl Default for MemoryBackend
impl Default for MemoryBackend
Source§impl StreamBackend for MemoryBackend
impl StreamBackend for MemoryBackend
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the backend
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the backend
Source§fn create_topic<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
_partitions: u32,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_topic<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
_partitions: u32,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new topic/stream
Source§fn delete_topic<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_topic<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a topic/stream
Source§fn list_topics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<TopicName>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_topics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<TopicName>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all topics/streams
Source§fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
event: StreamEvent,
) -> Pin<Box<dyn Future<Output = StreamResult<Offset>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
event: StreamEvent,
) -> Pin<Box<dyn Future<Output = StreamResult<Offset>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a single event
Source§fn send_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
events: Vec<StreamEvent>,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<Offset>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
events: Vec<StreamEvent>,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<Offset>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send multiple events as a batch
Source§fn receive_events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: Option<&'life2 ConsumerGroup>,
position: StreamPosition,
max_events: usize,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(StreamEvent, Offset)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn receive_events<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: Option<&'life2 ConsumerGroup>,
position: StreamPosition,
max_events: usize,
) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(StreamEvent, Offset)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Receive events from a topic
Source§fn commit_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
_partition: PartitionId,
offset: Offset,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
_partition: PartitionId,
offset: Offset,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Commit consumer offset
Source§fn seek<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
_partition: PartitionId,
position: StreamPosition,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn seek<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
_partition: PartitionId,
position: StreamPosition,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Seek to a specific position
Source§fn get_consumer_lag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<PartitionId, u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_consumer_lag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 TopicName,
consumer_group: &'life2 ConsumerGroup,
) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<PartitionId, u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get consumer lag information
Auto Trait Implementations§
impl Freeze for MemoryBackend
impl RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnsafeUnpin for MemoryBackend
impl UnwindSafe for MemoryBackend
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.