pub struct TevClient { /* private fields */ }Expand description
A connection to a Tev instance. Constructed using TevClient::wrap, TevClient::spawn or TevClient::spawn_path_default. Use TevClient::send to send commands.
Implementations§
Source§impl TevClient
impl TevClient
Sourcepub fn wrap(socket: TcpStream) -> Self
pub fn wrap(socket: TcpStream) -> Self
Create a TevClient from an existing TcpStream that’s connected to tev. If tev may not be running yet use TevClient::spawn or TevClient::spawn_path_default instead.
For example, if tev is already running on the default hostname:
let mut client = TevClient::wrap(TcpStream::connect("127.0.0.1:14158")?);Sourcepub fn spawn_path_default() -> Result<TevClient, TevError>
pub fn spawn_path_default() -> Result<TevClient, TevError>
Create a new TevClient by spawning tev assuming it is in PATH with the default hostname.
Sourcepub fn spawn(command: Command) -> Result<TevClient, TevError>
pub fn spawn(command: Command) -> Result<TevClient, TevError>
Crate a TevClient from a command that spawns tev.
If tev is in PATH and the default hostname should be used use TevClient::spawn_path_default instead.
let mut command = Command::new("path/to/tev");
command.arg("--hostname=127.0.0.1:14159");
let mut client = TevClient::spawn(command)?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for TevClient
impl RefUnwindSafe for TevClient
impl Send for TevClient
impl Sync for TevClient
impl Unpin for TevClient
impl UnwindSafe for TevClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more