Skip to main content

Prober

Trait Prober 

Source
pub trait Prober: Debug {
    // Required methods
    fn probe_transport(&self, transport: &Transport) -> Result<bool, Error>;
    fn probe(&self, url: &Url) -> Result<bool, Error>;
}
Expand description

Trait for probers that can detect control directories.

This trait defines the interface for probers, which are used to detect the presence of control directories (like .git or .bzr) in a location.

Required Methods§

Source

fn probe_transport(&self, transport: &Transport) -> Result<bool, Error>

Check if a control directory exists at the location specified by a transport.

§Parameters
  • transport - The transport to probe.
§Returns

Ok(true) if a control directory exists, Ok(false) if not, or an error if the probe could not be completed.

Source

fn probe(&self, url: &Url) -> Result<bool, Error>

Check if a control directory exists at the specified URL.

§Parameters
  • url - The URL to probe.
§Returns

Ok(true) if a control directory exists, Ok(false) if not, or an error if the probe could not be completed.

Implementors§

Source§

impl<T> Prober for T
where T: PyProber,