pub struct MoltbookClient { /* private fields */ }Implementations§
Source§impl MoltbookClient
impl MoltbookClient
pub fn new(api_key: String, debug: bool) -> Self
pub async fn get<T: DeserializeOwned>( &self, endpoint: &str, ) -> Result<T, ApiError>
pub async fn post<T: DeserializeOwned>( &self, endpoint: &str, body: &impl Serialize, ) -> Result<T, ApiError>
pub async fn post_file<T: DeserializeOwned>( &self, endpoint: &str, file_path: PathBuf, ) -> Result<T, ApiError>
pub async fn patch<T: DeserializeOwned>( &self, endpoint: &str, body: &impl Serialize, ) -> Result<T, ApiError>
pub async fn delete<T: DeserializeOwned>( &self, endpoint: &str, ) -> Result<T, ApiError>
Auto Trait Implementations§
impl Freeze for MoltbookClient
impl !RefUnwindSafe for MoltbookClient
impl Send for MoltbookClient
impl Sync for MoltbookClient
impl Unpin for MoltbookClient
impl UnsafeUnpin for MoltbookClient
impl !UnwindSafe for MoltbookClient
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