pub struct IsolateConfig {
pub timeout_ms: Option<u64>,
pub panic_barrier: bool,
}Expand description
Typed config surface for the isolate middleware — a blast-radius barrier
with an optional time budget and panic barrier around an inner pipe.
Fields§
§timeout_ms: Option<u64>Time budget in ms; the inner future is dropped and a 503 returned when
exceeded. None disables the timeout guard.
panic_barrier: boolConvert an inner panic into a 500 instead of unwinding the chain.
Implementations§
Source§impl IsolateConfig
impl IsolateConfig
Sourcepub fn builder() -> IsolateConfigBuilder
pub fn builder() -> IsolateConfigBuilder
Create an instance of IsolateConfig using the builder syntax
Source§impl IsolateConfig
impl IsolateConfig
Sourcepub fn into_isolate(self, inner: PipeHandle) -> Isolate<PipeHandle>
pub fn into_isolate(self, inner: PipeHandle) -> Isolate<PipeHandle>
Materialise the isolate middleware around inner.
Trait Implementations§
Source§impl Clone for IsolateConfig
impl Clone for IsolateConfig
Source§impl Debug for IsolateConfig
impl Debug for IsolateConfig
Source§impl Default for IsolateConfig
impl Default for IsolateConfig
Source§impl<'de> Deserialize<'de> for IsolateConfig
impl<'de> Deserialize<'de> for IsolateConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for IsolateConfig
impl Serialize for IsolateConfig
Source§impl Settings for IsolateConfig
impl Settings for IsolateConfig
Source§const PREFIX: Option<&'static str>
const PREFIX: Option<&'static str>
The struct’s own prefix, used only when it is the root of resolution.
When embedded as a nested field, the embedding field decides the prefix.
Source§fn from_env_with_prefix(__prefix: &str) -> Result<Self>
fn from_env_with_prefix(__prefix: &str) -> Result<Self>
Resolve using
prefix as the accumulated root instead of PREFIX.
Used by parent structs to push their namespace into nested fields.Source§fn override_from_env(&mut self) -> Result<()>
fn override_from_env(&mut self) -> Result<()>
Overwrite only the fields whose env keys are currently set, leaving the
rest untouched. Useful for layering env over file-loaded defaults.
Source§fn override_from_env_with_prefix(&mut self, __prefix: &str) -> Result<()>
fn override_from_env_with_prefix(&mut self, __prefix: &str) -> Result<()>
override_from_env with an explicit accumulated prefix.Auto Trait Implementations§
impl Freeze for IsolateConfig
impl RefUnwindSafe for IsolateConfig
impl Send for IsolateConfig
impl Sync for IsolateConfig
impl Unpin for IsolateConfig
impl UnsafeUnpin for IsolateConfig
impl UnwindSafe for IsolateConfig
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