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
impl WebCOwned
sourcepub fn parse(data: impl Into<Bytes>, options: &ParseOptions) -> ReadResult<Self>
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
pub fn as_webc_ref(&self) -> WebC<'_>
Methods from Deref<Target = WebC<'static>>§
pub fn get_main_args_for_command( &self, command: &str ) -> Result<Vec<String>, String>
pub fn get_atom_name_for_command( &self, api: &str, command: &str ) -> Result<String, String>
sourcepub fn get_volumes_for_package(&self, package: &str) -> Vec<String>
pub fn get_volumes_for_package(&self, package: &str) -> Vec<String>
Determines the available volumes for a given package
pub fn list_directories(&self, volume: &str) -> Vec<String>
sourcepub fn read_dir(
&self,
package: &str,
path: &str
) -> Result<Vec<FsEntry<'a>>, Error>
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
sourcepub fn get_file_entry(
&self,
package: &str,
path: &str
) -> Option<(String, OwnedFsEntryFile)>
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
sourcepub fn get_metadata(&self) -> &Manifest
pub fn get_metadata(&self) -> &Manifest
Returns a reference to the manifest
sourcepub fn get_package_name(&self) -> String
pub fn get_package_name(&self) -> String
Returns the current package name with
sourcepub fn get_atom(&self, package: &str, atom: &str) -> Result<&[u8], Error>
pub fn get_atom(&self, package: &str, atom: &str) -> Result<&[u8], Error>
Returns an atom by name for a given package
sourcepub fn get_volume(&self, package: &str, volume: &str) -> Option<&Volume<'a>>
pub fn get_volume(&self, package: &str, volume: &str) -> Option<&Volume<'a>>
Returns a reference to the filesystem volume of the package
sourcepub fn get_file(&self, package: &str, file_path: &str) -> Result<&[u8], Error>
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
sourcepub fn list_volumes(&self, package: &str) -> Vec<String>
pub fn list_volumes(&self, package: &str) -> Vec<String>
Returns a list of volumes for this package
sourcepub fn list_packages(&self) -> Vec<PackageInfo>
pub fn list_packages(&self) -> Vec<PackageInfo>
Returns a list of bundled “package@version” strings contained in this package
sourcepub fn list_atoms(&self) -> Vec<String>
pub fn list_atoms(&self) -> Vec<String>
Returns the atoms in the root package
sourcepub fn get_all_atoms(&self) -> IndexMap<String, &'a [u8]>
pub fn get_all_atoms(&self) -> IndexMap<String, &'a [u8]>
Returns a list of all atoms with bytes
sourcepub fn list_atoms_for_package(&self, package_orig: &str) -> Vec<String>
pub fn list_atoms_for_package(&self, package_orig: &str) -> Vec<String>
List the atoms for a given package
sourcepub fn list_commands(&self) -> Vec<&str>
pub fn list_commands(&self) -> Vec<&str>
List the available commands for the root package
pub fn get_volumes_as_fileblock(&self) -> Vec<u8> ⓘ
sourcepub fn into_bytes(&self, sign_bytes: GenerateChecksum) -> ReadResult<Vec<u8>>
pub fn into_bytes(&self, sign_bytes: GenerateChecksum) -> ReadResult<Vec<u8>>
Serialize the .webc file into bytes