Struct Client

Source
pub struct Client<C> { /* private fields */ }
Expand description

Command-server client holding active connection.

Implementations§

Source§

impl<C> Client<C>
where C: Connection,

Source

pub async fn run_command_os( &mut self, handler: &mut impl UiHandler, args: impl IntoIterator<Item = impl AsRef<OsStr>>, ) -> Result<i32>

Runs the Mercurial command specified in platform string.

Source§

impl Client<UnixConnection>

Source

pub async fn connect(path: impl AsRef<Path>) -> Result<Self>

Connects to a command server listening at the specified socket path.

Source§

impl<C> Client<C>

Source

pub fn server_spec(&self) -> &ServerSpec

Server capabilities, encoding, etc.

Source

pub fn borrow_protocol_mut(&mut self) -> &mut Protocol<C>

Mutably borrows the underlying protocol.

This is a low-level interface to implement new command handler.

Source§

impl<C> Client<C>
where C: Connection,

Source

pub async fn run_command( &mut self, handler: &mut impl UiHandler, args: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Result<i32>

Runs the Mercurial command specified in bytes.

§Panics

Panics if argument contains \0 character.

Source§

impl Client<PipeConnection>

Source

pub async fn spawn_at(dir: impl AsRef<Path>) -> Result<Self>

Spawns a server process at the specified directory with the default configuration.

Source

pub async fn spawn_with(command: &mut Command) -> Result<Self>

Spawns a server process by the given process builder.

Trait Implementations§

Source§

impl<C> AsRawFd for Client<C>
where C: AsRawFd,

Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl<C: Debug> Debug for Client<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C> Freeze for Client<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for Client<C>
where C: RefUnwindSafe,

§

impl<C> Send for Client<C>
where C: Send,

§

impl<C> Sync for Client<C>
where C: Sync,

§

impl<C> Unpin for Client<C>
where C: Unpin,

§

impl<C> UnwindSafe for Client<C>
where C: UnwindSafe,

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.