pub enum SandboxRequest {
CreateRealm {
realm: ServerEnd<ManagedRealmMarker>,
options: RealmOptions,
control_handle: SandboxControlHandle,
},
GetNetworkContext {
network_context: ServerEnd<NetworkContextMarker>,
control_handle: SandboxControlHandle,
},
}
Expand description
Sandbox
is a hermetic container for network emulation testing.
Every connection to Sandbox
represents a self-contained context where
[fuchsia.netemul/ManagedRealm
]s can be created. The
[fuchsia.netemul.network/NetworkContext
] instance offered by it is the
same that is exposed to any ManagedRealm
s created by the Sandbox
.
The lifetime of the created realms (and the context services) is bound to
the connection to the Sandbox
protocol. If the channel is closed, all the
realms and the components created within them will be terminated.
Variants§
CreateRealm
Creates a new realm configured by options
.
- request
realm
request handle to the newly created managed realm. - request
options
configures the setup and child components ofrealm
. Ifoptions
is invalid,realm
will be closed.
Errors are presented as an epitaph on the realm
channel.
- error
ZX_ERR_INVALID_ARGS
ifoptions
was invalid. - error
ZX_ERR_INTERNAL
for internal errors, including failures to build the requested component topology.
Fields
§
realm: ServerEnd<ManagedRealmMarker>
§
options: RealmOptions
§
control_handle: SandboxControlHandle
GetNetworkContext
Gets this sandbox’s network context.
- request
network_context
request handle to the network context.
Implementations§
Source§impl SandboxRequest
impl SandboxRequest
pub fn into_create_realm( self, ) -> Option<(ServerEnd<ManagedRealmMarker>, RealmOptions, SandboxControlHandle)>
pub fn into_get_network_context( self, ) -> Option<(ServerEnd<NetworkContextMarker>, SandboxControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SandboxRequest
impl !RefUnwindSafe for SandboxRequest
impl Send for SandboxRequest
impl Sync for SandboxRequest
impl Unpin for SandboxRequest
impl !UnwindSafe for SandboxRequest
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