pub struct ApiClient {
pub base_url: String,
pub api_token: Option<String>,
/* private fields */
}Fields§
§base_url: String§api_token: Option<String>Implementations§
Source§impl ApiClient
impl ApiClient
pub fn new(config: &Config) -> Self
pub fn set_base_url(&mut self, url: &str)
pub fn get_stats(&self) -> Result<Stats>
pub fn render_markdown(&self, text: &str) -> Result<String>
pub fn list_projects(&self, q: Option<&str>) -> Result<Vec<Project>>
pub fn create_project(&self, input: &ProjectInput) -> Result<Project>
pub fn update_project(&self, id: u64, input: &ProjectInput) -> Result<Project>
pub fn delete_project(&self, id: u64) -> Result<()>
pub fn list_prompts( &self, project_id: Option<u64>, scope: Option<&str>, pinned: Option<bool>, search: Option<&str>, ) -> Result<Vec<Prompt>>
pub fn get_prompt(&self, id: u64) -> Result<PromptDetail>
pub fn create_prompt(&self, input: &PromptInput) -> Result<PromptDetail>
pub fn update_prompt( &self, id: u64, input: &PromptInput, ) -> Result<PromptDetail>
pub fn delete_prompt(&self, id: u64) -> Result<()>
pub fn toggle_pin(&self, id: u64) -> Result<TogglePinResponse>
pub fn reorder_pinned(&self, ids: &[u64]) -> Result<()>
pub fn list_attachments(&self, prompt_id: u64) -> Result<Vec<Attachment>>
pub fn upload_attachment(&self, prompt_id: u64, file_path: &Path) -> Result<()>
pub fn delete_attachment( &self, prompt_id: u64, attachment_id: u64, ) -> Result<()>
pub fn download_attachment(&self, raw_url: &str, dest_path: &Path) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ApiClient
impl !UnwindSafe for ApiClient
impl Forget for ApiClient
impl Freeze for ApiClientwhere
*const ArcInner<InnerClientHandle> is !null: Freeze,
PhantomData<ArcInner<InnerClientHandle>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl UnsafeUnpin for ApiClientwhere
*const ArcInner<InnerClientHandle> is !null: UnsafeUnpin,
PhantomData<ArcInner<InnerClientHandle>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more