pub struct Response {
pub status: u8,
pub meta: String,
pub content: Vec<u8>,
pub certificate: X509,
}
Expand description
A gemini response.
Fields§
§status: u8
§meta: String
§content: Vec<u8>
§certificate: X509
The certificate of the responding server.
Implementations§
source§impl Response
impl Response
sourcepub fn is_gemtext(&self) -> bool
pub fn is_gemtext(&self) -> bool
Returns true if the response is gemtext.
sourcepub fn gemtext(&self) -> Result<String, ResponseErr>
pub fn gemtext(&self) -> Result<String, ResponseErr>
Return gemtext (if any) inside this response.
sourcepub fn text(&self) -> Result<String, ResponseErr>
pub fn text(&self) -> Result<String, ResponseErr>
Return utf8 text (if any) inside this response, regardless of mimetype.
sourcepub fn save_to_path(&self, path: impl Into<PathBuf>) -> Result<(), ResponseErr>
pub fn save_to_path(&self, path: impl Into<PathBuf>) -> Result<(), ResponseErr>
Save response to path.
sourcepub fn certificate_pem(&self) -> Result<String, ResponseErr>
pub fn certificate_pem(&self) -> Result<String, ResponseErr>
Return the server’s certificate pem
sourcepub fn certificate_info(&self) -> Result<String, ResponseErr>
pub fn certificate_info(&self) -> Result<String, ResponseErr>
Returns a human-readable string displaying info about the server’s certificate.
primarily for debugging purposes
sourcepub fn certificate_fingerprint(&self) -> Result<String, ResponseErr>
pub fn certificate_fingerprint(&self) -> Result<String, ResponseErr>
Return the server certificate’s fingerprint
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