[][src]Struct serbo::Instance

pub struct Instance {
    pub server_process: Child,
    pub port: u32,
    pub id: String,
    // some fields omitted
}

Represents a currently online server. Created by calling start from a Manager

Fields

server_process: Childport: u32id: String

Implementations

impl Instance[src]

pub fn stop(&mut self) -> Result<(), Error>[src]

Stops the server, killing the server process and the stdin and stdout threads

pub fn send(&mut self, msg: String) -> Result<(), Error>[src]

Sends a string to the server stdin

Arguments

  • msg - A String that contains the message to be sent to the server.

Remarks

The message should not contain a trailing newline, as the send method handles it.

pub fn get(&self, start: u32) -> Vec<String>[src]

Arguments

  • start The line number of the first line that should be returned

Remarks

The returned Vec will contain the lines in the range of start to the end of output

Auto Trait Implementations

impl !RefUnwindSafe for Instance

impl Send for Instance

impl Sync for Instance

impl Unpin for Instance

impl !UnwindSafe for Instance

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.