pub struct Response {
pub raw: Vec<u8>,
pub data: Option<String>,
pub mime_parts: Option<MimeParts>,
}
Expand description
Parsed Ribbit response
Contains the raw response data and parsed components based on the protocol version.
Fields§
§raw: Vec<u8>
Raw response data
data: Option<String>
Parsed data (PSV format)
mime_parts: Option<MimeParts>
MIME parts (V1 only)
Implementations§
Source§impl Response
impl Response
Sourcepub fn as_text(&self) -> Option<&str>
pub fn as_text(&self) -> Option<&str>
Get the data content as a string slice
This is a convenience method similar to Ribbit.NET’s ToString()
Sourcepub fn as_bpsv(&self) -> Result<BpsvDocument<'_>>
pub fn as_bpsv(&self) -> Result<BpsvDocument<'_>>
Parse the response data as BPSV
This allows direct access to the BPSV document structure. Note: This method adjusts HEX field lengths for Blizzard’s format.
§Errors
Returns an error if the response has no data or BPSV parsing fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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