Skip to main content

FileSystem

Struct FileSystem 

Source
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

Source

pub fn init() -> FileSystem

§Name

init

§Purpose

Initialises a SSVMContainer file system object

§Input

N/A

§Returns

FileSystem object

§Example

let fs = ssvm_container::storage::file_system::FileSystem::init();

Source

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);

Source

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);

Source

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);

Source

pub fn delete_application(&self, _application_uuid: &str) -> String

§Name

delete_application

§Purpose

Delete the application from the file system alltogether

§Input

An application’s uuid as a string

§Returns

The application uuid of the application that was deleted

§Example

ssvm_container::storage::file_system::FileSystem::delete_application(&fs, &uuid);

Trait Implementations§

Source§

impl Debug for FileSystem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V