[−][src]Struct blih_rs::Blih
Blih structure representing a Blih connection
Each intraction with Blih remote api is made with method
Methods
impl Blih
[src]
pub fn new(user: Option<&str>, token: Option<&str>, url: Option<&str>) -> Blih
[src]
return a new Blith struct
Description
If user
is equal to None
, the value of env var BLIH_USER
If token
is equal to None
, the value of env var BLIH_TOKEN
pub fn ask_password(&mut self) -> Result<(), BlihErr>
[src]
Promt the user for the password, and store a Sha512
of it.
pub fn get_user_agent(&self) -> &String
[src]
return the user_agent
pub fn get_user(&self) -> &Option<String>
[src]
return the user
pub fn set_user(&mut self, user: Option<String>)
[src]
set the token
pub fn get_token(&self) -> &Option<String>
[src]
return the token
pub fn set_token(&mut self, token: Option<String>)
[src]
set the token
pub fn whoami(&self) -> Result<String, BlihErr>
[src]
send a whoami request.
pub fn list_repo(&self) -> Result<String, BlihErr>
[src]
list all the repo on the remote
pub fn info_repo(&self, name: &str) -> Result<String, BlihErr>
[src]
print info about the provided repo
pub fn delete_repo(&self, name: &str) -> Result<String, BlihErr>
[src]
delete the repository on the remote
WARNING No confirmation required
pub fn create_repo(&self, name: &str) -> Result<String, BlihErr>
[src]
create a new repo
pub fn get_acl(&self, name: &str) -> Result<String, BlihErr>
[src]
pub fn set_acl(
&self,
name: &str,
user: &str,
acl: &str
) -> Result<String, BlihErr>
[src]
&self,
name: &str,
user: &str,
acl: &str
) -> Result<String, BlihErr>
pub fn list_key(&self) -> Result<String, BlihErr>
[src]
pub fn upload_key_str(&self, key: &str) -> Result<String, BlihErr>
[src]
pub fn upload_key_path(&self, key: &str) -> Result<String, BlihErr>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Blih
impl Send for Blih
impl Sync for Blih
impl Unpin for Blih
impl UnwindSafe for Blih
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,