Struct wildland_cargo_lib::api::cargo_lib::CargoLib
source · pub struct CargoLib { /* private fields */ }
Expand description
Structure aggregating and exposing public API of CargoLib library. All functionalities are exposed to application side through this structure (not all directly).
It can be created with create_cargo_lib
function.
As mentioned above, CargoLib does not try to expose all functionalities directly by its methods, but it can be treated as a starting point for using wildland core in a native app. To avoid programming invalid logic on the native app side, some functionalities are hidden in subsequent objects that can be obtained from CargoLib.
Usage of Foundation Storage API makes sense only within a user’s context, so in order to avoid
calling its methods before a user is created/retrieved access to Foundation Storage API is
enclosed within crate::api::cargo_user::CargoUser
object.
Filesystem like interface can be retrieved with the CargoLib::dfs_api
method.
Implementations§
source§impl CargoLib
impl CargoLib
pub fn new( lss: Box<dyn LocalSecureStorage>, fsa_config: FoundationStorageApiConfig, catlib_config: CatlibConfig, multidevice_state: UserConfig ) -> Result<Self, ClientCreationError>
pub fn storage_template_from_json( &self, content: Vec<u8> ) -> Result<StorageTemplate, StorageTemplateError>
pub fn storage_template_from_yaml( &self, content: Vec<u8> ) -> Result<StorageTemplate, StorageTemplateError>
sourcepub fn dfs_api(&self) -> Arc<dyn DfsFrontend>
pub fn dfs_api(&self) -> Arc<dyn DfsFrontend>
Returns DFS API object that may be used to build Filesystem-like UI.