pub struct SandboxContextArgs {
pub method: Option<String>,
pub path: Option<String>,
pub host: Option<String>,
pub scheme: Option<String>,
pub headers: Option<HashMap<String, SandboxValue>>,
pub query_params: Option<HashMap<String, SandboxValue>>,
pub body: Option<Value>,
pub body_base64: Option<String>,
pub remote_addr: Option<String>,
pub protocol: Option<String>,
pub message: Option<HashMap<String, Value>>,
pub response: Option<SandboxResponseArgs>,
}Fields§
§method: Option<String>HTTP method. Default GET.
path: Option<String>Request path without the query string, e.g. /hello/frenk. Default /.
host: Option<String>Host header value. Default sandbox.local.
scheme: Option<String>http (default) or https.
headers: Option<HashMap<String, SandboxValue>>Request headers as an object: {"authorization": "Bearer x", "accept": ["a", "b"]}.
query_params: Option<HashMap<String, SandboxValue>>Query parameters as an object (not a query string): {"page": "2"}.
body: Option<Value>Request body as text. A JSON body may be passed as a JSON string
("{\"a\":1}") or directly as an object — it is serialized for you.
Add a content-type header yourself when a plugin needs it.
body_base64: Option<String>Base64 body for binary payloads. Exclusive with body.
remote_addr: Option<String>Client address ip:port. Default 127.0.0.1:0.
protocol: Option<String>http1 (default) or http2.
message: Option<HashMap<String, Value>>Pre-seeded context.message entries (e.g. what an earlier node would
have set), keyed by name.
response: Option<SandboxResponseArgs>Seed the response to exercise response-phase plugins (response-rewrite,
loggers): {"status_code": 200, "headers": {...}, "body": "..."}.
Trait Implementations§
Source§impl Debug for SandboxContextArgs
impl Debug for SandboxContextArgs
Source§impl<'de> Deserialize<'de> for SandboxContextArgs
impl<'de> Deserialize<'de> for SandboxContextArgs
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>,
Source§impl JsonSchema for SandboxContextArgs
impl JsonSchema for SandboxContextArgs
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SandboxContextArgs
impl RefUnwindSafe for SandboxContextArgs
impl Send for SandboxContextArgs
impl Sync for SandboxContextArgs
impl Unpin for SandboxContextArgs
impl UnsafeUnpin for SandboxContextArgs
impl UnwindSafe for SandboxContextArgs
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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