Connector

Struct Connector 

Source
pub struct Connector { /* private fields */ }
Expand description

The Connector defines how to connect to the watchman server. You will typically use Connector::new to set up the connection with the environmental defaults. You might want to override those defaults in situations such as integration testing environments, or in extremely latency sensitive environments where the cost of performing discovery is a measurable overhead.

Implementations§

Source§

impl Connector

Source

pub fn new() -> Self

Set up the connector with the system defaults. If WATCHMAN_SOCK is set in the environment it will preset the local IPC socket path. Otherwise the connector will invoke the watchman CLI to perform discovery.

Source

pub fn watchman_cli_path<P: AsRef<Path>>(self, path: P) -> Self

If the watchman CLI is installed in a location that is not present in the PATH environment variable, this method is used to inform the connector of its location.

Source

pub fn unix_domain_socket<P: AsRef<Path>>(self, path: P) -> Self

Specify the unix domain socket path

Source

pub async fn connect(&self) -> Result<Client, Error>

Establish a connection to the watchman server. If the connector was configured to perform discovery (which is the default configuration), then this will attempt to start the watchman server.

Trait Implementations§

Source§

impl Default for Connector

Source§

fn default() -> Connector

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.