pub struct Client {
pub base: Url,
/* private fields */
}Fields§
§base: UrlImplementations§
Source§impl Client
impl Client
pub fn new(settings: &Settings) -> Result<Client>
pub fn key(&self) -> &str
pub fn origin(&self) -> String
pub fn url(&self, path: &str) -> Url
pub async fn whoami(&self) -> Result<WhoAmI>
Sourcepub async fn push(
&self,
id: Option<&str>,
body: Vec<u8>,
content_type: &str,
q: &PushQuery,
if_match: Option<i64>,
) -> Result<PushResponse>
pub async fn push( &self, id: Option<&str>, body: Vec<u8>, content_type: &str, q: &PushQuery, if_match: Option<i64>, ) -> Result<PushResponse>
if_match: refuse (412, exit 5) unless the document is at this revision.
pub async fn doc(&self, id: &str) -> Result<DocDetail>
pub async fn list(&self, q: &ListQuery) -> Result<ListResponse>
Sourcepub async fn project_docs(&self, project: &str) -> Result<Vec<DocSummary>>
pub async fn project_docs(&self, project: &str) -> Result<Vec<DocSummary>>
Every live document of a project, page by page. Sorted by creation, which a push doesn’t change, so no document moves between pages while they are read.
pub async fn raw( &self, id: &str, path: Option<&str>, rev: Option<i64>, ) -> Result<Vec<u8>>
pub async fn patch(&self, id: &str, p: &PatchDoc) -> Result<DocSummary>
pub async fn delete(&self, id: &str) -> Result<()>
pub async fn say( &self, id: &str, text: &str, reply_to: Option<i64>, ) -> Result<SayOut>
pub async fn events( &self, id: &str, after: Option<i64>, wait: u64, kinds: Option<&str>, ) -> Result<EventsResponse>
pub async fn download(&self, url: &str) -> Result<Vec<u8>>
pub async fn keys(&self) -> Result<Vec<KeyInfo>>
pub async fn create_key(&self, req: &CreateKeyRequest) -> Result<CreatedKey>
Sourcepub async fn doc_at(&self, project: &str, path: &str) -> Result<DocSummary>
pub async fn doc_at(&self, project: &str, path: &str) -> Result<DocSummary>
The document a project path means (exact path, or the bundle that holds it).
pub async fn projects(&self) -> Result<Vec<ProjectInfo>>
pub async fn create_project( &self, req: &CreateProject, ) -> Result<ProjectCreated>
pub async fn mappings(&self, slug: &str) -> Result<MappingList>
pub async fn set_mappings( &self, slug: &str, list: &[Mapping], ) -> Result<MappingList>
pub async fn revoke_key(&self, id: i64) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Forget for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin 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