pub struct NetworkSynchronousProxy { /* private fields */ }
Implementations§
Source§impl NetworkSynchronousProxy
impl NetworkSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<NetworkEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<NetworkEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn add_port(
&self,
port: ClientEnd<PortMarker>,
interface: ServerEnd<InterfaceMarker>,
) -> Result<(), Error>
pub fn add_port( &self, port: ClientEnd<PortMarker>, interface: ServerEnd<InterfaceMarker>, ) -> Result<(), Error>
Adds a port to the network.
- request
port
port to be added. - request
interface
provides control over the interface.
Sourcepub fn get_config(
&self,
___deadline: MonotonicInstant,
) -> Result<NetworkConfig, Error>
pub fn get_config( &self, ___deadline: MonotonicInstant, ) -> Result<NetworkConfig, Error>
Gets network configuration.
Sourcepub fn get_name(&self, ___deadline: MonotonicInstant) -> Result<String, Error>
pub fn get_name(&self, ___deadline: MonotonicInstant) -> Result<String, Error>
Gets network name.
Sourcepub fn set_config(
&self,
config: &NetworkConfig,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn set_config( &self, config: &NetworkConfig, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Updates network configuration.
Sourcepub fn attach_endpoint(
&self,
name: &str,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn attach_endpoint( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Attaches endpoint with given name to network.
Sourcepub fn remove_endpoint(
&self,
name: &str,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn remove_endpoint( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Removes endpoint with given name from network.
Sourcepub fn create_fake_endpoint(
&self,
ep: ServerEnd<FakeEndpointMarker>,
) -> Result<(), Error>
pub fn create_fake_endpoint( &self, ep: ServerEnd<FakeEndpointMarker>, ) -> Result<(), Error>
Injects a fake endpoint.
Sourcepub fn start_capture(
&self,
name: &str,
___deadline: MonotonicInstant,
) -> Result<i32, Error>
pub fn start_capture( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<i32, Error>
Starts capturing packet in this network.
The packet capture will be stored at /custom_artifacts/{name}.pcapng
.
Returns [ZX_ERR_ALREADY_EXISTS
] if the capturing is already started
in this network.
Sourcepub fn stop_capture(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
pub fn stop_capture(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
Stops capturing packets. This function is guaranteed to succeed.
The packet capture will be stored in the file at the path chosen when capturing started. The packet capture will stop automatically once the network is destroyed regardless of whether this method is called.
Trait Implementations§
Source§impl Debug for NetworkSynchronousProxy
impl Debug for NetworkSynchronousProxy
Source§impl SynchronousProxy for NetworkSynchronousProxy
impl SynchronousProxy for NetworkSynchronousProxy
Source§type Proxy = NetworkProxy
type Proxy = NetworkProxy
Source§type Protocol = NetworkMarker
type Protocol = NetworkMarker
Proxy
controls.