pub struct FileSystem { /* private fields */ }Expand description
A file object which facilitates CRUD style operations on the file system The default storage path is the calling user’s home directory
Implementations§
Source§impl FileSystem
impl FileSystem
Sourcepub fn init() -> FileSystem
pub fn init() -> FileSystem
Sourcepub fn create_application(&self, _bytecode_wasm: &str) -> String
pub fn create_application(&self, _bytecode_wasm: &str) -> String
§Name
create_application
§Purpose
Store Wasm on the file system so that it’s funtions can be executed later
§Input
An instance of the FileSystem object A complete .wasm file in string format
§Returns
A unique identifier which can be used to access the application later
§Example
let bytecode_wasm = String::from(“0x1234567890”); let uuid = ssvm_container::storage::file_system::FileSystem::create_application(&fs, &bytecode_wasm);
Sourcepub fn read_application(&self, _application_uuid: &str) -> String
pub fn read_application(&self, _application_uuid: &str) -> String
§Name
read_application
§Purpose
Read the Wasm of a given application
§Input
An instance of the FileSystem object An application’s uuid as a string
§Returns
A complete .wasm file’s contents, as a string
§Example
let bytecode_wasm_string = ssvm_container::storage::file_system::FileSystem::read_application(&fs, &uuid);
Sourcepub fn update_application(
&self,
_application_uuid: &str,
_bytecode_wasm: &str,
) -> String
pub fn update_application( &self, _application_uuid: &str, _bytecode_wasm: &str, ) -> String
§Name
update_application
§Purpose
Update the Wasm of a given application (overrides existing .wasm file)
§Input
An instance of the FileSystem object A complete .wasm file in string format
§Returns
A unique identifier which can be used to access the application later
§Example
ssvm_container::storage::file_system::FileSystem::update_application(&fs, &uuid, &bytecode_wasm_update);