pub struct EncryptedBodyRequestBuilder<'a, T> { /* private fields */ }Expand description
A request builder that VEIL-seals the body before sending.
Obtained from RequestBuilder::encryption. Finalise with
send (async) or
send_sync (sync).
The expected response is also VEIL-sealed and is opened transparently.
Implementations§
Source§impl<'a, T: Encode> EncryptedBodyRequestBuilder<'a, T>
impl<'a, T: Encode> EncryptedBodyRequestBuilder<'a, T>
Sourcepub async fn send<R>(self) -> Result<R, ClientError>
pub async fn send<R>(self) -> Result<R, ClientError>
Sends the request asynchronously.
Before the request leaves, the body is VEIL-sealed using the SerializationKey
supplied to .encryption(). The server receives a
raw application/octet-stream payload. When the response arrives, its bytes are
VEIL-opened with the same key to produce R. If either sealing or opening fails
the error is wrapped in ClientError::Serialization.
Sourcepub fn send_sync<R>(self) -> Result<R, ClientError>
pub fn send_sync<R>(self) -> Result<R, ClientError>
Sends the request synchronously.
The body is VEIL-sealed with the configured SerializationKey before the wire
send. The response bytes, once received, are VEIL-opened with the same key to
produce R. Any cipher failure is wrapped in ClientError::Serialization.