pub struct Resources { /* private fields */ }
Expand description
Resources used by igvmfilegen to generate IGVM files. These are generated by build tooling and not checked into the repo.
Implementations§
Source§impl Resources
impl Resources
Sourcepub fn new(
resources: HashMap<ResourceType, PathBuf>,
) -> Result<Self, AbsolutePathError>
pub fn new( resources: HashMap<ResourceType, PathBuf>, ) -> Result<Self, AbsolutePathError>
Create a new set of resources. Returns an error if any of the paths are not absolute.
Sourcepub fn resources(&self) -> &HashMap<ResourceType, PathBuf>
pub fn resources(&self) -> &HashMap<ResourceType, PathBuf>
Get the resources for this set.
Sourcepub fn get(&self, resource: ResourceType) -> Option<&PathBuf>
pub fn get(&self, resource: ResourceType) -> Option<&PathBuf>
Get the resource path for a given resource type.
Sourcepub fn check_required(
&self,
required: &[ResourceType],
) -> Result<(), MissingResourcesError>
pub fn check_required( &self, required: &[ResourceType], ) -> Result<(), MissingResourcesError>
Check that the required resources are present. On error, returns which resources are missing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resources
impl<'de> Deserialize<'de> for Resources
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Resources
impl RefUnwindSafe for Resources
impl Send for Resources
impl Sync for Resources
impl Unpin for Resources
impl UnwindSafe for Resources
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more