pub struct NetworkProxy { /* private fields */ }
Implementations§
Source§impl NetworkProxy
impl NetworkProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.netemul.network/Network.
Sourcepub fn take_event_stream(&self) -> NetworkEventStream
pub fn take_event_stream(&self) -> NetworkEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
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,
) -> QueryResponseFut<NetworkConfig, DefaultFuchsiaResourceDialect>
pub fn get_config( &self, ) -> QueryResponseFut<NetworkConfig, DefaultFuchsiaResourceDialect>
Gets network configuration.
Sourcepub fn get_name(
&self,
) -> QueryResponseFut<String, DefaultFuchsiaResourceDialect>
pub fn get_name( &self, ) -> QueryResponseFut<String, DefaultFuchsiaResourceDialect>
Gets network name.
Sourcepub fn set_config(
&self,
config: &NetworkConfig,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
pub fn set_config( &self, config: &NetworkConfig, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
Updates network configuration.
Sourcepub fn attach_endpoint(
&self,
name: &str,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
pub fn attach_endpoint( &self, name: &str, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
Attaches endpoint with given name to network.
Sourcepub fn remove_endpoint(
&self,
name: &str,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
pub fn remove_endpoint( &self, name: &str, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
pub fn start_capture( &self, name: &str, ) -> QueryResponseFut<i32, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn stop_capture( &self, ) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
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 Clone for NetworkProxy
impl Clone for NetworkProxy
Source§fn clone(&self) -> NetworkProxy
fn clone(&self) -> NetworkProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for NetworkProxy
impl Debug for NetworkProxy
Source§impl NetworkProxyInterface for NetworkProxy
impl NetworkProxyInterface for NetworkProxy
type GetConfigResponseFut = QueryResponseFut<NetworkConfig>
type GetNameResponseFut = QueryResponseFut<String>
type SetConfigResponseFut = QueryResponseFut<i32>
type AttachEndpointResponseFut = QueryResponseFut<i32>
type RemoveEndpointResponseFut = QueryResponseFut<i32>
type StartCaptureResponseFut = QueryResponseFut<i32>
type StopCaptureResponseFut = QueryResponseFut<()>
fn add_port( &self, port: ClientEnd<PortMarker>, interface: ServerEnd<InterfaceMarker>, ) -> Result<(), Error>
fn get_config(&self) -> Self::GetConfigResponseFut
fn get_name(&self) -> Self::GetNameResponseFut
fn set_config(&self, config: &NetworkConfig) -> Self::SetConfigResponseFut
fn attach_endpoint(&self, name: &str) -> Self::AttachEndpointResponseFut
fn remove_endpoint(&self, name: &str) -> Self::RemoveEndpointResponseFut
fn create_fake_endpoint( &self, ep: ServerEnd<FakeEndpointMarker>, ) -> Result<(), Error>
fn start_capture(&self, name: &str) -> Self::StartCaptureResponseFut
fn stop_capture(&self) -> Self::StopCaptureResponseFut
Source§impl Proxy for NetworkProxy
impl Proxy for NetworkProxy
Source§type Protocol = NetworkMarker
type Protocol = NetworkMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for NetworkProxy
impl !RefUnwindSafe for NetworkProxy
impl Send for NetworkProxy
impl Sync for NetworkProxy
impl Unpin for NetworkProxy
impl !UnwindSafe for NetworkProxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)