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
sourceimpl UserApi
impl UserApi
pub fn generate_mnemonic(
&self
) -> Result<MnemonicPayload, SingleVariantError<CryptoError>>
sourcepub fn create_mnemonic_from_vec(
&self,
words: Vec<String>
) -> Result<MnemonicPayload, SingleVariantError<String>>
pub fn create_mnemonic_from_vec(
&self,
words: Vec<String>
) -> Result<MnemonicPayload, SingleVariantError<String>>
Creates MnemonicPayload
basing on a vector of words. The result may be used for creation
User with UserApi::create_user_from_mnemonic
.
pub fn create_user_from_entropy(
&self,
entropy: Vec<u8>,
device_name: String
) -> Result<CargoUser, SingleVariantError<UserCreationError>>
pub fn create_user_from_mnemonic(
&self,
mnemonic: &MnemonicPayload,
device_name: String
) -> Result<CargoUser, SingleVariantError<UserCreationError>>
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more