pub struct Client { /* private fields */ }
Expand description

Raw API for taking to RabbitMQ stream

For high level APIs check crate::Environment

Implementations§

source§

impl Client

source

pub async fn connect( opts: impl Into<ClientOptions> ) -> Result<Client, ClientError>

source

pub async fn server_properties(&self) -> HashMap<String, String>

Get client’s server properties.

source

pub async fn connection_properties(&self) -> HashMap<String, String>

Get client’s connection properties.

source

pub async fn set_handler<H: MessageHandler>(&self, handler: H)

source

pub async fn close(&self) -> RabbitMQStreamResult<()>

source

pub async fn subscribe( &self, subscription_id: u8, stream: &str, offset_specification: OffsetSpecification, credit: u16, properties: HashMap<String, String> ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn unsubscribe( &self, subscription_id: u8 ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn create_stream( &self, stream: &str, options: HashMap<String, String> ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn delete_stream( &self, stream: &str ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn credit( &self, subscription_id: u8, credit: u16 ) -> RabbitMQStreamResult<()>

source

pub async fn metadata( &self, streams: Vec<String> ) -> RabbitMQStreamResult<HashMap<String, StreamMetadata>>

source

pub async fn store_offset( &self, reference: &str, stream: &str, offset: u64 ) -> RabbitMQStreamResult<()>

source

pub async fn query_offset( &self, reference: String, stream: &str ) -> Result<u64, ClientError>

source

pub async fn declare_publisher( &self, publisher_id: u8, publisher_reference: Option<String>, stream: &str ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn delete_publisher( &self, publisher_id: u8 ) -> RabbitMQStreamResult<GenericResponse>

source

pub async fn publish<T: BaseMessage>( &self, publisher_id: u8, messages: impl Into<Vec<T>> ) -> RabbitMQStreamResult<Vec<u64>>

source

pub async fn query_publisher_sequence( &self, reference: &str, stream: &str ) -> Result<u64, ClientError>

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more