Enum edge_schema::schema::CgiDialect
source · pub enum CgiDialect {
Rfc3875,
Wcgi,
}
Expand description
The CGI dialect to use when running a CGI workload.
Variants§
Implementations§
source§impl CgiDialect
impl CgiDialect
pub const CUSTOM_SECTION_NAME: &str = "cgi-dialect"
sourcepub fn from_wasm(wasm: &[u8]) -> Option<CgiDialect>
pub fn from_wasm(wasm: &[u8]) -> Option<CgiDialect>
Try to identify which CgiDialect
should be used based on the
WebAssembly module’s binary representation.
§Implementation Notes
This currently works by looking through the WebAssembly binary for a
custom section called CgiDialect::CUSTOM_SECTION_NAME
and matching
it against one of the known CGI dialects.
This whole process is kinda hacky because it means you need to alter your binary to include the custom section. In the future, the CGI dialect should be specified using some external mechanism like metadata.
pub fn prepare_environment_variables( self, parts: Parts, env: &mut HashMap<String, String> )
sourcepub async fn extract_response_header(
self,
stdout: &mut (impl AsyncBufRead + Unpin)
) -> Result<Parts, CgiError>
pub async fn extract_response_header( self, stdout: &mut (impl AsyncBufRead + Unpin) ) -> Result<Parts, CgiError>
Extract the http::response::Parts
from a CGI script’s stdout.
§Note
This might stall if reading from stdout stalls. Care should be taken to avoid waiting forever (e.g. by adding a timeout).
pub const fn to_str(self) -> &'static str
Trait Implementations§
source§impl Clone for CgiDialect
impl Clone for CgiDialect
source§fn clone(&self) -> CgiDialect
fn clone(&self) -> CgiDialect
Returns a copy 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 CgiDialect
impl Debug for CgiDialect
source§impl Default for CgiDialect
impl Default for CgiDialect
source§fn default() -> CgiDialect
fn default() -> CgiDialect
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for CgiDialect
impl<'de> Deserialize<'de> for CgiDialect
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<CgiDialect, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<CgiDialect, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for CgiDialect
impl Display for CgiDialect
source§impl FromStr for CgiDialect
impl FromStr for CgiDialect
§type Err = UnknownCgiDialect
type Err = UnknownCgiDialect
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<CgiDialect, <CgiDialect as FromStr>::Err>
fn from_str(s: &str) -> Result<CgiDialect, <CgiDialect as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl JsonSchema for CgiDialect
impl JsonSchema for CgiDialect
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq for CgiDialect
impl PartialEq for CgiDialect
source§fn eq(&self, other: &CgiDialect) -> bool
fn eq(&self, other: &CgiDialect) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CgiDialect
impl Serialize for CgiDialect
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for CgiDialect
impl Eq for CgiDialect
impl StructuralPartialEq for CgiDialect
Auto Trait Implementations§
impl Freeze for CgiDialect
impl RefUnwindSafe for CgiDialect
impl Send for CgiDialect
impl Sync for CgiDialect
impl Unpin for CgiDialect
impl UnwindSafe for CgiDialect
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.