Enum wcgi_host::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: &'static 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<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 Display for CgiDialect
impl Display for CgiDialect
source§impl FromStr for CgiDialect
impl FromStr for CgiDialect
source§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
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.