pub struct MessageQueue { /* private fields */ }Implementations§
Source§impl MessageQueue
impl MessageQueue
Sourcepub fn with_obfuscation(
config: TrafficObfuscationConfig,
) -> (Self, Receiver<()>)
pub fn with_obfuscation( config: TrafficObfuscationConfig, ) -> (Self, Receiver<()>)
Creates a new message queue with traffic obfuscation
Sourcepub async fn enable_obfuscation(&mut self, config: TrafficObfuscationConfig)
pub async fn enable_obfuscation(&mut self, config: TrafficObfuscationConfig)
Enable traffic obfuscation
Sourcepub async fn enqueue(&self, msg: NetworkMessage) -> Result<(), NetworkError>
pub async fn enqueue(&self, msg: NetworkMessage) -> Result<(), NetworkError>
Enqueues a message with the specified priority
Sourcepub async fn dequeue(&self) -> Option<MessageEnvelope>
pub async fn dequeue(&self) -> Option<MessageEnvelope>
Dequeues the next message by priority
Sourcepub async fn purge_expired(&self)
pub async fn purge_expired(&self)
Purge expired messages
Sourcepub async fn process_batch(&self) -> Result<Vec<MessageEnvelope>, NetworkError>
pub async fn process_batch(&self) -> Result<Vec<MessageEnvelope>, NetworkError>
Process batched messages if obfuscation is enabled
Sourcepub async fn get_obfuscation_stats(&self) -> Option<ObfuscationStats>
pub async fn get_obfuscation_stats(&self) -> Option<ObfuscationStats>
Get obfuscation statistics
Auto Trait Implementations§
impl !RefUnwindSafe for MessageQueue
impl !UnwindSafe for MessageQueue
impl Freeze for MessageQueue
impl Send for MessageQueue
impl Sync for MessageQueue
impl Unpin for MessageQueue
impl UnsafeUnpin for MessageQueue
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> ErasedDestructor for Twhere
T: 'static,
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 more