pub struct GetResponse<T = Value> { /* private fields */ }Expand description
A response from a GetRequest.
The response is generic over a type parameter T. You can use this to strongly type the response. Alternatively you can use the default generic parameter of serde_json::Value, which can represent any valid response from the database.
The GetResponse implements Deref with respect to the returned document. You can also consume the response and retrieve the document with the into_inner method.
Implementations§
Source§impl<T> GetResponse<T>
impl<T> GetResponse<T>
Sourcepub fn meta_data(&self) -> &GetResponseMeta
pub fn meta_data(&self) -> &GetResponseMeta
Return metadata about the response.
Which metadata is available will depend on the options set in the request.
Sourcepub fn into_inner(self) -> Option<T>
pub fn into_inner(self) -> Option<T>
Consume the response and return the contained document
Trait Implementations§
Source§impl<T: Debug> Debug for GetResponse<T>
impl<T: Debug> Debug for GetResponse<T>
Source§impl<'de, T> Deserialize<'de> for GetResponse<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for GetResponse<T>where
T: Deserialize<'de>,
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
Auto Trait Implementations§
impl<T> Freeze for GetResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for GetResponse<T>where
T: RefUnwindSafe,
impl<T> Send for GetResponse<T>where
T: Send,
impl<T> Sync for GetResponse<T>where
T: Sync,
impl<T> Unpin for GetResponse<T>where
T: Unpin,
impl<T> UnwindSafe for GetResponse<T>where
T: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more