pub struct Actor { /* private fields */ }
Expand description
Make a gemini request.
Implementations§
source§impl Actor
impl Actor
sourcepub fn user_agent(self, useragent: UserAgent) -> Self
pub fn user_agent(self, useragent: UserAgent) -> Self
Please include a user-agent if youâre making any kind of service that indescriminately uses other peoplesâ content on gemini.
This allows people to block types of services they donât want to access their content.
More info: robots.txt for Gemini
sourcepub fn timeout(self, timeout: impl Into<Duration>) -> Self
pub fn timeout(self, timeout: impl Into<Duration>) -> Self
Set timeout for the initial connection.
The default is 5 seconds.
sourcepub async fn get(&self, url: impl Into<String>) -> Result<Response, ActorError>
pub async fn get(&self, url: impl Into<String>) -> Result<Response, ActorError>
Send gemini request to url.
Url can elide the gemini://
prefix. Itâs up to you.
sourcepub async fn input(
&self,
url: impl Into<String>,
input: impl Into<String>
) -> Result<Response, ActorError>
pub async fn input( &self, url: impl Into<String>, input: impl Into<String> ) -> Result<Response, ActorError>
Send gemini request to url with input.
Input is automatically percent-encoded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Actor
impl RefUnwindSafe for Actor
impl Send for Actor
impl Sync for Actor
impl Unpin for Actor
impl UnwindSafe for Actor
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