pub struct MeshPeerResponse {
pub schema: String,
pub request_id: String,
pub status_code: u16,
pub body: Vec<u8>,
pub error: Option<String>,
}Expand description
Logical Peer RPC HTTP response returned through the Gateway mesh relay.
Fields§
§schema: StringSchema marker. Must be MESH_HTTP_SCHEMA_V1.
request_id: StringStable request identity.
status_code: u16HTTP status code returned by the target peer host.
body: Vec<u8>Encoded response body returned by the target peer host.
error: Option<String>Controlled transport failure when the target worker could not complete the request.
Implementations§
Source§impl MeshPeerResponse
impl MeshPeerResponse
Sourcepub fn ok(request_id: impl Into<String>, response: PeerRpcHttpResponse) -> Self
pub fn ok(request_id: impl Into<String>, response: PeerRpcHttpResponse) -> Self
Creates a successful logical HTTP response.
Sourcepub fn rejected(request_id: impl Into<String>, error: impl Into<String>) -> Self
pub fn rejected(request_id: impl Into<String>, error: impl Into<String>) -> Self
Creates a controlled relay failure.
Sourcepub fn into_peer_response(self) -> Result<PeerRpcHttpResponse, PeerRpcError>
pub fn into_peer_response(self) -> Result<PeerRpcHttpResponse, PeerRpcError>
Converts this relay response to a logical Peer RPC HTTP response.
Trait Implementations§
Source§impl Clone for MeshPeerResponse
impl Clone for MeshPeerResponse
Source§fn clone(&self) -> MeshPeerResponse
fn clone(&self) -> MeshPeerResponse
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 MeshPeerResponse
impl Debug for MeshPeerResponse
Source§impl<'de> Deserialize<'de> for MeshPeerResponse
impl<'de> Deserialize<'de> for MeshPeerResponse
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
impl Eq for MeshPeerResponse
Source§impl PartialEq for MeshPeerResponse
impl PartialEq for MeshPeerResponse
Source§impl Serialize for MeshPeerResponse
impl Serialize for MeshPeerResponse
impl StructuralPartialEq for MeshPeerResponse
Auto Trait Implementations§
impl Freeze for MeshPeerResponse
impl RefUnwindSafe for MeshPeerResponse
impl Send for MeshPeerResponse
impl Sync for MeshPeerResponse
impl Unpin for MeshPeerResponse
impl UnsafeUnpin for MeshPeerResponse
impl UnwindSafe for MeshPeerResponse
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