Trait clircle::Clircle

source ·
pub trait Clircle: Eq + TryFrom<Stdio> + TryFrom<File> {
    // Required method
    fn into_inner(self) -> Option<File>;

    // Provided methods
    fn surely_conflicts_with(&self, _other: &Self) -> bool { ... }
    fn stdin() -> Option<Self> { ... }
    fn stdout() -> Option<Self> { ... }
    fn stderr() -> Option<Self> { ... }
}
Expand description

The Clircle trait describes the public interface of the crate. It contains all the platform-independent functionality. Additionally, an implementation of Eq is required, that gives a simple way to check for conflicts, if using the more elaborate surely_conflicts_with method is not wanted. This trait is implemented for the structs UnixIdentifier and WindowsIdentifier.

Required Methods§

source

fn into_inner(self) -> Option<File>

Returns the File that was used for From<File>. If the instance was created otherwise, this may also return None.

Provided Methods§

source

fn surely_conflicts_with(&self, _other: &Self) -> bool

Checks whether the two values will without doubt conflict. By default, this always returns false, but implementors can override this method. Currently, only UnixIdentifier overrides surely_conflicts_with.

source

fn stdin() -> Option<Self>

Shorthand for try_from(Stdio::Stdin).

source

fn stdout() -> Option<Self>

Shorthand for try_from(Stdio::Stdout).

source

fn stderr() -> Option<Self>

Shorthand for try_from(Stdio::Stderr).

Implementors§