pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn new(url: impl IntoUrl, version: Version) -> Result<Client, Error>
pub fn with_auth(self, auth: String) -> Client
pub fn with_branch(self, branch: String) -> Client
pub async fn request( &self, method: Method, endpoint: impl AsRef<str>, body: Option<Vec<u8>>, ) -> Result<Response, Error>
pub async fn find( &self, path: impl Into<Path>, ) -> Result<Option<(Vec<u8>, Hash)>, Error>
pub async fn hash(&self, path: impl Into<Path>) -> Result<Option<Hash>, Error>
pub async fn add( &self, path: impl Into<Path>, data: Vec<u8>, ) -> Result<Hash, Error>
pub async fn remove(&self, path: impl Into<Path>) -> Result<(), Error>
pub async fn gc(&self) -> Result<(), Error>
pub async fn list( &self, path: impl Into<Path>, ) -> Result<BTreeMap<Path, Hash>, Error>
pub async fn versions( &self, path: impl Into<Path>, ) -> Result<Vec<(Hash, Commit)>, Error>
pub async fn branches(&self) -> Result<Vec<String>, Error>
pub async fn create_branch(&self, name: impl AsRef<str>) -> Result<(), Error>
pub async fn delete_branch(&self, name: impl AsRef<str>) -> Result<(), Error>
pub async fn snapshot(&self) -> Result<Commit, Error>
pub async fn restore(&self, hash: &Commit) -> Result<(), Error>
pub async fn restore_path( &self, hash: &Commit, path: impl Into<Path>, ) -> Result<(), Error>
pub async fn rollback(&self, path: impl Into<Path>) -> Result<(), Error>
pub async fn contains(&self, path: impl Into<Path>) -> Result<bool, Error>
pub async fn set( &self, path: impl Into<Path>, hash: &Hash, ) -> Result<Hash, Error>
pub async fn commit_info(&self, commit: &Commit) -> Result<CommitInfo, Error>
pub async fn auth(&self, method: Method) -> Result<bool, Error>
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