webc::v1

Struct WebCOwned

Source
pub struct WebCOwned {
    pub webc: WebC<'static>,
    /* private fields */
}
Available on crate feature v1 only.
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 webc_hash(&self) -> Option<[u8; 32]>

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

Source§

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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 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<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T