pub struct Connection { /* private fields */ }
Expand description
A connection from a client.
Implementations§
Source§impl Connection
The server API.
impl Connection
The server API.
Sourcepub async fn get_process_list(&self) -> Result<Vec<Process>>
pub async fn get_process_list(&self) -> Result<Vec<Process>>
Fetches the list of processes running on the agent.
§Errors
Returns an error if serialization/deserialization failed or communication with the client failed.
Sourcepub async fn get_resource_usage(&self) -> Result<ResourceUsage>
pub async fn get_resource_usage(&self) -> Result<ResourceUsage>
Fetches the resource usage of an agent.
§Errors
Returns an error if serialization/deserialization failed or communication with the client failed.
Sourcepub async fn send_allowlist(&self, allowlist: &HostNetworkGroup) -> Result<()>
pub async fn send_allowlist(&self, allowlist: &HostNetworkGroup) -> Result<()>
Sends the allowlist for network addresses.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_blocklist(&self, blocklist: &HostNetworkGroup) -> Result<()>
pub async fn send_blocklist(&self, blocklist: &HostNetworkGroup) -> Result<()>
Sends the blocklist for network addresses.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_config_update_cmd(&self) -> Result<()>
pub async fn send_config_update_cmd(&self) -> Result<()>
Sends the config-update command.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_filtering_rules(
&self,
list: &[TrafficFilterRule],
) -> Result<()>
pub async fn send_filtering_rules( &self, list: &[TrafficFilterRule], ) -> Result<()>
Sends the traffic filtering rules.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_internal_network_list(
&self,
list: &HostNetworkGroup,
) -> Result<()>
pub async fn send_internal_network_list( &self, list: &HostNetworkGroup, ) -> Result<()>
Sends the internal network list.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_ping(&self) -> Result<()>
pub async fn send_ping(&self) -> Result<()>
Sends the ping message.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_reboot_cmd(&self) -> Result<()>
pub async fn send_reboot_cmd(&self) -> Result<()>
Sends the reboot command.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_sampling_policies(
&self,
list: &[SamplingPolicy],
) -> Result<()>
pub async fn send_sampling_policies( &self, list: &[SamplingPolicy], ) -> Result<()>
Sends the sampling policies.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_shutdown_cmd(&self) -> Result<()>
pub async fn send_shutdown_cmd(&self) -> Result<()>
Sends the shutdown command.
§Errors
Returns an error if serialization failed or communication with the client failed.
Sourcepub async fn send_tor_exit_node_list(&self, list: &[String]) -> Result<()>
pub async fn send_tor_exit_node_list(&self, list: &[String]) -> Result<()>
Sends a list of Tor exit nodes to the client.
§Errors
Returns an error if serialization failed or communication with the client failed.
Source§impl Connection
impl Connection
Sourcepub fn from_quinn(conn: Connection) -> Self
pub fn from_quinn(conn: Connection) -> Self
Creates a new connection from a QUIC connection from the quinn
crate.
Sourcepub fn peer_identity(&self) -> Option<Box<dyn Any>>
pub fn peer_identity(&self) -> Option<Box<dyn Any>>
Returns the cryptographic identity of the peer.
This directly corresponds to the peer_identity
method of the underlying
quinn::Connection
. In the future, this method may be removed in favor
of this crate’s own implementation to provide additional features.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more