pub struct HttpSseResponse {
pub status_code: Option<u16>,
pub headers: Option<HashMap<String, Vec<String>>>,
pub events: Option<Vec<SseEvent>>,
pub close_connection: Option<bool>,
pub delay: Option<Delay>,
}Expand description
Builder for a Server-Sent Events (SSE) streaming response action.
Serialized as the httpSseResponse action in an expectation.
§Example
use mockserver_client::{HttpSseResponse, SseEvent};
let sse = HttpSseResponse::new()
.status_code(200)
.header("Content-Type", "text/event-stream")
.event(SseEvent::new().event("message").data("hello").id("1"))
.close_connection(true);Fields§
§status_code: Option<u16>§headers: Option<HashMap<String, Vec<String>>>§events: Option<Vec<SseEvent>>§close_connection: Option<bool>§delay: Option<Delay>Implementations§
Source§impl HttpSseResponse
impl HttpSseResponse
Trait Implementations§
Source§impl Clone for HttpSseResponse
impl Clone for HttpSseResponse
Source§fn clone(&self) -> HttpSseResponse
fn clone(&self) -> HttpSseResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HttpSseResponse
impl Debug for HttpSseResponse
Source§impl Default for HttpSseResponse
impl Default for HttpSseResponse
Source§fn default() -> HttpSseResponse
fn default() -> HttpSseResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HttpSseResponse
impl<'de> Deserialize<'de> for HttpSseResponse
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 PartialEq for HttpSseResponse
impl PartialEq for HttpSseResponse
Source§fn eq(&self, other: &HttpSseResponse) -> bool
fn eq(&self, other: &HttpSseResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HttpSseResponse
impl Serialize for HttpSseResponse
impl StructuralPartialEq for HttpSseResponse
Auto Trait Implementations§
impl Freeze for HttpSseResponse
impl RefUnwindSafe for HttpSseResponse
impl Send for HttpSseResponse
impl Sync for HttpSseResponse
impl Unpin for HttpSseResponse
impl UnsafeUnpin for HttpSseResponse
impl UnwindSafe for HttpSseResponse
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