pub struct ExecutionResult { /* private fields */ }Expand description
Result of PHP script execution.
Contains the HTTP status code, response headers, body output, and any PHP errors/warnings/notices logged during execution.
Implementations§
Source§impl ExecutionResult
impl ExecutionResult
pub fn new( status: u16, body: Vec<u8>, headers: Vec<ResponseHeader>, messages: Vec<ExecutionMessage>, ) -> Self
pub fn body(&self) -> Vec<u8> ⓘ
pub fn take_body(&mut self) -> Vec<u8> ⓘ
pub fn body_string(&self) -> String
pub fn body_str(&self) -> Result<&str, Utf8Error>
pub fn status_code(&self) -> u16
pub fn has_errors(&self) -> bool
pub fn has_message_level(&self, level: SyslogLevel) -> bool
pub fn errors(&self) -> impl Iterator<Item = &ExecutionMessage>
pub fn all_messages(&self) -> impl Iterator<Item = &ExecutionMessage>
pub fn all_headers(&self) -> impl Iterator<Item = &ResponseHeader>
Sourcepub fn header_val(&self, name: &str) -> Option<&str>
pub fn header_val(&self, name: &str) -> Option<&str>
Returns the first header value for a given header name, if any.
Sourcepub fn header_vals(&self, name: &str) -> Vec<&str>
pub fn header_vals(&self, name: &str) -> Vec<&str>
Returns all headers for a given header name e.g. “cookie” -> vec![“SESSID=abc123”, “lang=en”, “…”]
pub fn is_success(&self) -> bool
pub fn is_redirect(&self) -> bool
pub fn is_client_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Source§impl ExecutionResult
impl ExecutionResult
pub fn into_http_response(self) -> Response<Vec<u8>>
Trait Implementations§
Source§impl Clone for ExecutionResult
impl Clone for ExecutionResult
Source§fn clone(&self) -> ExecutionResult
fn clone(&self) -> ExecutionResult
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 ExecutionResult
impl Debug for ExecutionResult
Source§impl Default for ExecutionResult
impl Default for ExecutionResult
Auto Trait Implementations§
impl Freeze for ExecutionResult
impl RefUnwindSafe for ExecutionResult
impl Send for ExecutionResult
impl Sync for ExecutionResult
impl Unpin for ExecutionResult
impl UnwindSafe for ExecutionResult
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