pub struct HttpObjectCallback {
pub client_id: String,
pub response_callback: Option<bool>,
pub delay: Option<Delay>,
pub primary: Option<bool>,
}Expand description
Object (closure) callback action — delegates the response (or forward) to a client-side closure invoked over the callback WebSocket.
The client_id is the id assigned by MockServer when the client opens the
callback WebSocket (/_mockserver_callback_websocket). When a request
matches, the server pushes it over that socket and the client’s registered
closure produces the response. Serialized as httpResponseObjectCallback or
httpForwardObjectCallback in an expectation.
Most users do not construct this directly — use
MockServerClient::mock_with_callback,
which opens the shared WebSocket, registers the closure, and wires up the
client_id automatically.
Fields§
§client_id: String§response_callback: Option<bool>§delay: Option<Delay>§primary: Option<bool>Implementations§
Source§impl HttpObjectCallback
impl HttpObjectCallback
Trait Implementations§
Source§impl Clone for HttpObjectCallback
impl Clone for HttpObjectCallback
Source§fn clone(&self) -> HttpObjectCallback
fn clone(&self) -> HttpObjectCallback
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 HttpObjectCallback
impl Debug for HttpObjectCallback
Source§impl Default for HttpObjectCallback
impl Default for HttpObjectCallback
Source§fn default() -> HttpObjectCallback
fn default() -> HttpObjectCallback
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HttpObjectCallback
impl<'de> Deserialize<'de> for HttpObjectCallback
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 HttpObjectCallback
impl PartialEq for HttpObjectCallback
Source§fn eq(&self, other: &HttpObjectCallback) -> bool
fn eq(&self, other: &HttpObjectCallback) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HttpObjectCallback
impl Serialize for HttpObjectCallback
impl StructuralPartialEq for HttpObjectCallback
Auto Trait Implementations§
impl Freeze for HttpObjectCallback
impl RefUnwindSafe for HttpObjectCallback
impl Send for HttpObjectCallback
impl Sync for HttpObjectCallback
impl Unpin for HttpObjectCallback
impl UnsafeUnpin for HttpObjectCallback
impl UnwindSafe for HttpObjectCallback
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