pub struct SocktopConnector {
pub config: ConnectorConfig,
/* private fields */
}Expand description
Main connector for communicating with socktop agents
Fields§
§config: ConnectorConfigImplementations§
Source§impl SocktopConnector
impl SocktopConnector
Sourcepub fn new(config: ConnectorConfig) -> SocktopConnector
pub fn new(config: ConnectorConfig) -> SocktopConnector
Create a new connector with the given configuration
Source§impl SocktopConnector
impl SocktopConnector
Sourcepub async fn connect(&mut self) -> Result<(), ConnectorError>
pub async fn connect(&mut self) -> Result<(), ConnectorError>
Connect to the agent
Sourcepub async fn request(
&mut self,
request: AgentRequest,
) -> Result<AgentResponse, ConnectorError>
pub async fn request( &mut self, request: AgentRequest, ) -> Result<AgentResponse, ConnectorError>
Send a request to the agent and get the response
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the connector is connected
Sourcepub async fn disconnect(&mut self) -> Result<(), ConnectorError>
pub async fn disconnect(&mut self) -> Result<(), ConnectorError>
Disconnect from the agent
Auto Trait Implementations§
impl !Freeze for SocktopConnector
impl !RefUnwindSafe for SocktopConnector
impl Send for SocktopConnector
impl Sync for SocktopConnector
impl Unpin for SocktopConnector
impl !UnwindSafe for SocktopConnector
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