Struct wildland_cargo_lib::api::user::UserApi   
source · pub struct UserApi { /* private fields */ }Expand description
User management API
CargoUser can be created with the following methods:
Creating a new user means:
- checking if one does not exist yet
 - generating forest identity
 - generating device identity
 - saving forest in CatLib
 - saving forest uuid (CatLib key) in LSS
 - saving forest and device identities (keypairs) in LSS
 
Implementations§
source§impl UserApi
 
impl UserApi
pub fn generate_mnemonic(&self) -> Result<MnemonicPayload, CreateMnemonicError>
sourcepub fn create_mnemonic_from_vec(
    &self,
    words: Vec<String>
) -> Result<MnemonicPayload, CreateMnemonicError>
 
pub fn create_mnemonic_from_vec( &self, words: Vec<String> ) -> Result<MnemonicPayload, CreateMnemonicError>
Creates MnemonicPayload basing on a vector of words. The result may be used for creation
User with UserApi::create_user_from_mnemonic.
It validates provided words
sourcepub fn create_mnemonic_from_string(
    &self,
    words: String
) -> Result<MnemonicPayload, CreateMnemonicError>
 
pub fn create_mnemonic_from_string( &self, words: String ) -> Result<MnemonicPayload, CreateMnemonicError>
Creates MnemonicPayload basing on a space separated 12-word string. The result may be used for creation
User with UserApi::create_user_from_mnemonic.
It validates provided words
sourcepub fn create_user_from_entropy(
    &self,
    entropy: Vec<u8>,
    device_name: String
) -> Result<CargoUser, UserCreationError>
 
pub fn create_user_from_entropy( &self, entropy: Vec<u8>, device_name: String ) -> Result<CargoUser, UserCreationError>
Creates user from entropy.
Assumes high quality entropy of arbitrary length (>= 32 bytes) what is validated.
pub fn create_user_from_mnemonic( &self, mnemonic: &MnemonicPayload, device_name: String ) -> Result<CargoUser, UserCreationError>
sourcepub fn get_user(&self) -> Result<CargoUser, UserRetrievalError>
 
pub fn get_user(&self) -> Result<CargoUser, UserRetrievalError>
Gets user if it exists
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UserApi
impl Send for UserApi
impl Sync for UserApi
impl Unpin for UserApi
impl !UnwindSafe for UserApi
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