pub struct Client {
pub client: Client,
/* private fields */
}Expand description
The client
Fields§
§client: ClientThe inner http client
Implementations§
Source§impl Client
impl Client
Sourcepub async fn get_scraped_post(&self, id: &str) -> Result<ScrapedPost, Error>
pub async fn get_scraped_post(&self, id: &str) -> Result<ScrapedPost, Error>
Sourcepub async fn get_scraped_user(&self, name: &str) -> Result<ScrapedUser, Error>
pub async fn get_scraped_user(&self, name: &str) -> Result<ScrapedUser, Error>
Sourcepub async fn list_posts(
&self,
builder: ListPostsBuilder,
) -> Result<Vec<ListPostsPost>, Error>
pub async fn list_posts( &self, builder: ListPostsBuilder, ) -> Result<Vec<ListPostsPost>, Error>
Sourcepub fn set_token<T>(&self, token: T)
pub fn set_token<T>(&self, token: T)
Set the token to use for future requests.
This allows the use of functions that require authorization.
Get the cookie store.
Sourcepub async fn create_post(&self, data: CreatePostBuilder) -> Result<Post, Error>
pub async fn create_post(&self, data: CreatePostBuilder) -> Result<Post, Error>
Sourcepub async fn update_post(
&self,
id: &str,
data: UpdatePostBuilder,
) -> Result<Post, Error>
pub async fn update_post( &self, id: &str, data: UpdatePostBuilder, ) -> Result<Post, Error>
Sourcepub async fn add_post_images<I>(
&self,
id: &str,
images: I,
) -> Result<Post, Error>where
I: IntoIterator<Item = UploadPostFile>,
pub async fn add_post_images<I>(
&self,
id: &str,
images: I,
) -> Result<Post, Error>where
I: IntoIterator<Item = UploadPostFile>,
Sourcepub async fn get_file(&self, id: &str) -> Result<PostFile, Error>
pub async fn get_file(&self, id: &str) -> Result<PostFile, Error>
Get a file by id.
Currently, this is implemented according to the API spec, but the API will always return no data for some reason. It is likely that this endpoint is disabled. As a result, this function is currently useless.
§Authorization
This function REQUIRES a token.
Sourcepub async fn update_files_bulk<I>(
&self,
files: I,
) -> Result<Vec<PostFile>, Error>where
I: IntoIterator<Item = FileUpdate>,
pub async fn update_files_bulk<I>(
&self,
files: I,
) -> Result<Vec<PostFile>, Error>where
I: IntoIterator<Item = FileUpdate>,
Update files in bulk.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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