pub struct InstanceConfigBuilder { /* private fields */ }
Expand description
Builder for InstanceConfig with ergonomic APIs
Implementations§
Source§impl InstanceConfigBuilder
impl InstanceConfigBuilder
Sourcepub fn memory_limit<T: MemoryUnit>(self, amount: T) -> Self
pub fn memory_limit<T: MemoryUnit>(self, amount: T) -> Self
Set memory limit using human-readable units
Sourcepub fn timeout<T: TimeUnit>(self, duration: T) -> Self
pub fn timeout<T: TimeUnit>(self, duration: T) -> Self
Set timeout using human-readable duration
Sourcepub fn filesystem_read<P: AsRef<Path>>(self, paths: &[P]) -> Self
pub fn filesystem_read<P: AsRef<Path>>(self, paths: &[P]) -> Self
Allow filesystem read access to paths
Sourcepub fn filesystem_write<P: AsRef<Path>>(self, paths: &[P]) -> Self
pub fn filesystem_write<P: AsRef<Path>>(self, paths: &[P]) -> Self
Allow filesystem write access to paths
Sourcepub fn network_deny_all(self) -> Self
pub fn network_deny_all(self) -> Self
Deny all network access
Sourcepub fn network_loopback_only(self) -> Self
pub fn network_loopback_only(self) -> Self
Allow only loopback network access
Sourcepub fn network_allow_domains(self, domains: &[impl AsRef<str>]) -> Self
pub fn network_allow_domains(self, domains: &[impl AsRef<str>]) -> Self
Allow network access to specific domains
Sourcepub fn network_allow_ports(self, ports: &[u16]) -> Self
pub fn network_allow_ports(self, ports: &[u16]) -> Self
Allow network access to specific ports
Sourcepub fn network_max_connections(self, max: usize) -> Self
pub fn network_max_connections(self, max: usize) -> Self
Set maximum number of network connections
Sourcepub fn cpu_time_limit<T: TimeUnit>(self, duration: T) -> Self
pub fn cpu_time_limit<T: TimeUnit>(self, duration: T) -> Self
Set CPU time limit
Sourcepub fn io_ops_limit(self, ops_per_sec: u32) -> Self
pub fn io_ops_limit(self, ops_per_sec: u32) -> Self
Set maximum file operations per second
Sourcepub fn enable_debug(self) -> Self
pub fn enable_debug(self) -> Self
Enable debugging
Sourcepub fn allow_process_spawn(self) -> Self
pub fn allow_process_spawn(self) -> Self
Allow process spawning
Sourcepub fn max_threads(self, max: usize) -> Self
pub fn max_threads(self, max: usize) -> Self
Set maximum number of threads
Sourcepub fn build(self) -> Result<InstanceConfig>
pub fn build(self) -> Result<InstanceConfig>
Build the configuration
Trait Implementations§
Source§impl Clone for InstanceConfigBuilder
impl Clone for InstanceConfigBuilder
Source§fn clone(&self) -> InstanceConfigBuilder
fn clone(&self) -> InstanceConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InstanceConfigBuilder
impl Debug for InstanceConfigBuilder
Auto Trait Implementations§
impl Freeze for InstanceConfigBuilder
impl RefUnwindSafe for InstanceConfigBuilder
impl Send for InstanceConfigBuilder
impl Sync for InstanceConfigBuilder
impl Unpin for InstanceConfigBuilder
impl UnwindSafe for InstanceConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self
file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more