Struct webc::v1::WebCOwned

source ·
pub struct WebCOwned {
    pub webc: WebC<'static>,
    /* private fields */
}
Expand description

Owned version of the WebC file that carries its data along the parsed WebC<'static>

Fields§

§webc: WebC<'static>

Implementations§

source§

impl WebCOwned

source

pub fn parse(data: impl Into<Bytes>, options: &ParseOptions) -> ReadResult<Self>

Same as WebC::parse, but keeps the resulting data in memory, instead of referencing it

source

pub fn as_webc_ref(&self) -> WebC<'_>

Methods from Deref<Target = WebC<'static>>§

source

pub fn get_main_args_for_command( &self, command: &str ) -> Result<Vec<String>, String>

source

pub fn get_atom_name_for_command( &self, api: &str, command: &str ) -> Result<String, String>

source

pub fn get_volumes_for_package(&self, package: &str) -> Vec<String>

Determines the available volumes for a given package

source

pub fn list_directories(&self, volume: &str) -> Vec<String>

source

pub fn read_dir( &self, package: &str, path: &str ) -> Result<Vec<FsEntry<'a>>, Error>

Returns the directory entries or an error if the directory does not exist

source

pub fn get_file_entry( &self, package: &str, path: &str ) -> Option<(String, OwnedFsEntryFile)>

Looks for the first volume containing “entry”, scoped to the given package

source

pub fn get_metadata(&self) -> &Manifest

Returns a reference to the manifest

source

pub fn get_package_name(&self) -> String

Returns the current package name with

source

pub fn get_atom(&self, package: &str, atom: &str) -> Result<&[u8], Error>

Returns an atom by name for a given package

source

pub fn get_volume(&self, package: &str, volume: &str) -> Option<&Volume<'a>>

Returns a reference to the filesystem volume of the package

source

pub fn get_file(&self, package: &str, file_path: &str) -> Result<&[u8], Error>

Returns a file for a given package - if you want to use a non-default volume, prefix the file_path with volume://, for example, metadata://README.md

source

pub fn list_volumes(&self, package: &str) -> Vec<String>

Returns a list of volumes for this package

source

pub fn list_packages(&self) -> Vec<PackageInfo>

Returns a list of bundled “package@version” strings contained in this package

source

pub fn list_atoms(&self) -> Vec<String>

Returns the atoms in the root package

source

pub fn get_all_atoms(&self) -> IndexMap<String, &'a [u8]>

Returns a list of all atoms with bytes

source

pub fn list_atoms_for_package(&self, package_orig: &str) -> Vec<String>

List the atoms for a given package

source

pub fn list_commands(&self) -> Vec<&str>

List the available commands for the root package

source

pub fn get_volumes_as_fileblock(&self) -> Vec<u8>

source

pub fn into_bytes(&self, sign_bytes: GenerateChecksum) -> ReadResult<Vec<u8>>

Serialize the .webc file into bytes

Trait Implementations§

source§

impl Clone for WebCOwned

source§

fn clone(&self) -> WebCOwned

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WebCOwned

source§

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

Formats the value using the given formatter. Read more
source§

impl Deref for WebCOwned

§

type Target = WebC<'static>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<WebCOwned> for Container

source§

fn from(value: WebCOwned) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.