[−][src]Struct tokio_hglib::Protocol
Connection wrapper to process channel requests and responses.
This provides a low-level interface to communicate with the Mercurial command server.
Methods
impl<C> Protocol<C>
[src]
pub fn new(conn: C) -> Self
[src]
Creates a new Protocol that wraps the given connection.
pub fn into_connection(self) -> C
[src]
Unwraps the underlying Connection
.
impl<C> Protocol<C> where
C: Connection,
[src]
C: Connection,
pub async fn send_command<'_>(&'_ mut self, cmd: impl Into<Bytes>) -> Result<()>
[src]
Sends the command of no argument without waiting for response.
This is equivalent to OneShotRequest::start()
of tokio-hglib 0.2.
For MessageLoop::start()
, call this function and fetch responses.
pub async fn send_command_with_args<'_>(
&'_ mut self,
cmd: impl Into<Bytes>,
packed_args: impl Into<Bytes>
) -> Result<()>
[src]
&'_ mut self,
cmd: impl Into<Bytes>,
packed_args: impl Into<Bytes>
) -> Result<()>
Sends the command and arguments without waiting for response.
This is equivalent to OneShotRequest::start_with_args()
of tokio-hglib 0.2.
For MessageLoop::start_with_args()
, call this function and fetch responses.
pub async fn send_data<'_>(&'_ mut self, data: impl Into<Bytes>) -> Result<()>
[src]
Sends the given data back to the server.
For MessageLoop::resume_with_data()
of tokio-hglib 0.2, call this function
and fetch responses.
pub async fn query<'_>(&'_ mut self, cmd: impl Into<Bytes>) -> Result<Bytes>
[src]
Sends the command of no argument, and fetches the result data.
This is equivalent to OneShotQuery::start()
of tokio-hglib 0.2.
pub async fn query_with_args<'_>(
&'_ mut self,
cmd: impl Into<Bytes>,
packed_args: impl Into<Bytes>
) -> Result<Bytes>
[src]
&'_ mut self,
cmd: impl Into<Bytes>,
packed_args: impl Into<Bytes>
) -> Result<Bytes>
Sends the command and arguments, and fetches the result data.
This is equivalent to OneShotQuery::start_with_args()
of tokio-hglib 0.2.
pub async fn fetch_response<'_>(&'_ mut self) -> Result<ChannelMessage>
[src]
Fetches response message from the server.
This is equivalent to MessageLoop::resume()
of tokio-hglib 0.2.
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for Protocol<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for Protocol<C> where
C: Send,
C: Send,
impl<C> Sync for Protocol<C> where
C: Sync,
C: Sync,
impl<C> Unpin for Protocol<C> where
C: Unpin,
C: Unpin,
impl<C> UnwindSafe for Protocol<C> where
C: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,