[][src]Struct asyncnsq::reader::Reader

pub struct Reader {
    pub stream: Arc<TcpStream>,
    pub max_inflight: i32,
    pub connected: Arc<Mutex<bool>>,
    pub msg_sender: Arc<Sender<Option<Msg>>>,
    pub msg_receiver: Receiver<Option<Msg>>,
    pub data_bufer: Arc<Mutex<Vec<u8>>>,
    pub address: Address,
    pub identify_config: String,
}

the reader struct

Fields

stream: Arc<TcpStream>max_inflight: i32connected: Arc<Mutex<bool>>msg_sender: Arc<Sender<Option<Msg>>>msg_receiver: Receiver<Option<Msg>>data_bufer: Arc<Mutex<Vec<u8>>>address: Addressidentify_config: String

Methods

impl Reader[src]

pub async fn reconnect<'_>(&'_ mut self) -> Result<()>[src]

reconnect of the stream. close the old one and create a new one deal with the msgs which use the old closed stream use new stream to deal with the msg

pub async fn connect<'_>(&'_ mut self) -> Result<()>[src]

connect a stream

pub async fn sub<'_, '_, '_>(
    &'_ self,
    nsq_topic: &'_ str,
    nsq_channel: &'_ str
) -> Result<()>
[src]

send sub topic command

Auto Trait Implementations

impl !RefUnwindSafe for Reader

impl Send for Reader

impl Sync for Reader

impl Unpin for Reader

impl !UnwindSafe for Reader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.