Struct provider_archive::ProviderArchive
source · [−]pub struct ProviderArchive { /* private fields */ }
Expand description
A provider archive is a specialized ZIP file that contains a set of embedded and signed claims (a .JWT file) as well as a list of binary files, one plugin library for each supported target architecture and OS combination
Implementations
sourceimpl ProviderArchive
impl ProviderArchive
sourcepub fn new(
capid: &str,
name: &str,
vendor: &str,
rev: Option<i32>,
ver: Option<String>
) -> ProviderArchive
pub fn new(
capid: &str,
name: &str,
vendor: &str,
rev: Option<i32>,
ver: Option<String>
) -> ProviderArchive
Creates a new provider archive in memory, to which native library files can be added.
sourcepub fn add_library(&mut self, target: &str, input: &[u8]) -> Result<()>
pub fn add_library(&mut self, target: &str, input: &[u8]) -> Result<()>
Adds a native library file (.so, .dylib, .dll) to the archive for a given target string
sourcepub fn targets(&self) -> Vec<String>
pub fn targets(&self) -> Vec<String>
Gets the list of architecture/OS targets within the archive
sourcepub fn target_bytes(&self, target: &str) -> Option<Vec<u8>>
pub fn target_bytes(&self, target: &str) -> Option<Vec<u8>>
Retrieves the raw bytes for a given target
sourcepub fn claims(&self) -> Option<Claims<CapabilityProvider>>
pub fn claims(&self) -> Option<Claims<CapabilityProvider>>
Returns the embedded claims associated with this archive. Note that claims are not available while building a new archive. They are only available after the archive has been written or if the archive was loaded from an existing file
sourcepub fn try_load(input: &[u8]) -> Result<ProviderArchive>
pub fn try_load(input: &[u8]) -> Result<ProviderArchive>
Attempts to read a Provider Archive (PAR) file’s bytes to analyze and verify its contents. The embedded claims in this archive will be validated, and the file hashes contained in those claims will be compared and verified against hashes computed at load time. This prevents the contents of the archive from being modified without the embedded claims being re-signed
Auto Trait Implementations
impl RefUnwindSafe for ProviderArchive
impl Send for ProviderArchive
impl Sync for ProviderArchive
impl Unpin for ProviderArchive
impl UnwindSafe for ProviderArchive
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more