pub struct Page {
pub url: Url,
pub header: Header,
pub body: Option<String>,
}
Expand description
Single Gemini page
See https://gemini.circumlunar.space/docs/specification.html for more information.
Fields§
§url: Url
Page’s URL
header: Header
Page’s single header
body: Option<String>
Page’s optional body
Implementations§
Source§impl Page
impl Page
Sourcepub async fn fetch(
url: &Url,
tls_validation: Option<ServerTLSValidation>,
) -> Result<Page>
pub async fn fetch( url: &Url, tls_validation: Option<ServerTLSValidation>, ) -> Result<Page>
Fetch the given Gemini link.
Does not follow redirects or other status codes.
Sourcepub async fn fetch_from(
url: &Url,
addr: SocketAddr,
tls_validation: Option<ServerTLSValidation>,
) -> Result<Page>
pub async fn fetch_from( url: &Url, addr: SocketAddr, tls_validation: Option<ServerTLSValidation>, ) -> Result<Page>
Fetch the given Gemini link from the specified socket address (e.g. a proxy).
Does not follow redirects or other status codes.
Sourcepub async fn fetch_and_handle_redirects(url: &Url) -> Result<Page>
pub async fn fetch_and_handle_redirects(url: &Url) -> Result<Page>
Fetch the given Gemini link while following redirects
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
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