pub struct Call<'a, T> { /* private fields */ }Expand description
One request, built and waiting, that knows what its answer deserialises into.
Implementations§
Source§impl<T: DeserializeOwned> Call<'_, T>
impl<T: DeserializeOwned> Call<'_, T>
Sourcepub fn operation(&self) -> &Operation
pub fn operation(&self) -> &Operation
What the document says about the operation this call was built from: whether it writes, and which gates it stands behind.
A Rust caller is trusted and is stopped by nothing here. A caller that
wants the same gate a CLI has hands this to Plan::decide, which is
what the finalize-voucher verb in the example does.
Sourcepub fn request(&self) -> Result<HttpRequest, Error>
pub fn request(&self) -> Result<HttpRequest, Error>
The exact bytes that go on the wire. A CLI prints this for a dry run; a test asserts on it.
Sourcepub fn send<C: SyncClient>(&self, client: &C) -> Result<T, Error>
pub fn send<C: SyncClient>(&self, client: &C) -> Result<T, Error>
Send it and deserialise the answer.
Sourcepub async fn send_async<C: AsyncClient>(&self, client: &C) -> Result<T, Error>
pub async fn send_async<C: AsyncClient>(&self, client: &C) -> Result<T, Error>
The same, inside a runtime.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Call<'a, T>
impl<'a, T> RefUnwindSafe for Call<'a, T>
impl<'a, T> Send for Call<'a, T>
impl<'a, T> Sync for Call<'a, T>
impl<'a, T> Unpin for Call<'a, T>
impl<'a, T> UnsafeUnpin for Call<'a, T>
impl<'a, T> UnwindSafe for Call<'a, T>
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