pub struct WebsocketApiResponse<T> {
pub raw: Value,
pub rate_limits: Option<Vec<WebsocketApiRateLimit>>,
/* private fields */
}Fields§
§raw: Value§rate_limits: Option<Vec<WebsocketApiRateLimit>>Implementations§
Source§impl<T> WebsocketApiResponse<T>where
T: DeserializeOwned,
impl<T> WebsocketApiResponse<T>where
T: DeserializeOwned,
Sourcepub fn data(self) -> Result<T>
pub fn data(self) -> Result<T>
Deserializes the raw JSON value into the generic type T.
§Returns
A Result containing the deserialized value of type T if successful,
or a serde_json::Error if deserialization fails.
§Errors
Returns an error if deserialization fails.
§Examples
// Assuming WebsocketApiResponse contains a raw JSON value
let response: WebsocketApiResponseresponse.data()?;
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for WebsocketApiResponse<T>
impl<T> RefUnwindSafe for WebsocketApiResponse<T>where
T: RefUnwindSafe,
impl<T> Send for WebsocketApiResponse<T>where
T: Send,
impl<T> Sync for WebsocketApiResponse<T>where
T: Sync,
impl<T> Unpin for WebsocketApiResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for WebsocketApiResponse<T>
impl<T> UnwindSafe for WebsocketApiResponse<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