pub struct Connection { /* private fields */ }Expand description
An active connection, on which requests can be executed, and responses received.
The request/response mechanism is serial, so if a request is made before the response from the previous one has been fully received, you’ll get a Error::OperationInProgress error.
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn send_request(&mut self, request: &str) -> Result<Vec<Message>>
pub async fn send_request(&mut self, request: &str) -> Result<Vec<Message>>
Sends a request to the server and gets a vec of response messages. The terminating Message::Ok is not included.
Sourcepub async fn show_interfaces_summary(&mut self) -> Result<Vec<InterfaceSummary>>
pub async fn show_interfaces_summary(&mut self) -> Result<Vec<InterfaceSummary>>
Sends a show interfaces summary request and returns the parsed response as a
list of InterfaceSummary entries, one each for an interface.
Sourcepub async fn show_interfaces(&mut self) -> Result<Vec<ShowInterfacesMessage>>
pub async fn show_interfaces(&mut self) -> Result<Vec<ShowInterfacesMessage>>
Sends a show interfaces request and returns the parsed response as a
list of ShowInterfacesMessage entries, one each for an interface.
Sourcepub async fn show_protocols(
&mut self,
pattern: Option<&str>,
) -> Result<Vec<Protocol>>
pub async fn show_protocols( &mut self, pattern: Option<&str>, ) -> Result<Vec<Protocol>>
Sends a show protocols [<pattern>] request and returns the parsed response as a
list of InterfaceSummary entries, one for each protocol.
If pattern is specified, results of only those protocols is returned, which
match the pattern.
Sourcepub async fn show_protocols_details(
&mut self,
pattern: Option<&str>,
) -> Result<Vec<ShowProtocolDetailsMessage>>
pub async fn show_protocols_details( &mut self, pattern: Option<&str>, ) -> Result<Vec<ShowProtocolDetailsMessage>>
Sends a show protocols all [<pattern>] request and returns the parsed response as a
list of ShowProtocolDetailsMessage entries, one for each protocol instance.
If pattern is specified, results of only those protocols is returned, which
match the pattern.
Sourcepub async fn show_status(&mut self) -> Result<ShowStatusMessage>
pub async fn show_status(&mut self) -> Result<ShowStatusMessage>
Sends a show status request, and returns a semantically parsed response
in the form of ShowStatusMessage