#[non_exhaustive]pub struct ResourceRequest {
pub name: String,
pub kind: ResourceKind,
pub package: Option<String>,
}Expand description
A request for a named resource of a given kind.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringFile name as TeX asked for it, without the owning package.
kind: ResourceKindKind of file TeX asked for.
package: Option<String>Owning package of an ResourceKind::Asset request.
Implementations§
Source§impl ResourceRequest
impl ResourceRequest
Sourcepub fn new(name: impl Into<String>, kind: ResourceKind) -> Self
pub fn new(name: impl Into<String>, kind: ResourceKind) -> Self
A request for name of the given kind.
Sourcepub fn asset(package: impl Into<String>, name: impl Into<String>) -> Self
pub fn asset(package: impl Into<String>, name: impl Into<String>) -> Self
A request for an asset file owned by package.
Sourcepub fn canonical_name(&self) -> String
pub fn canonical_name(&self) -> String
The name providers key resources by, package/name for an asset and the file name otherwise.
Trait Implementations§
Source§impl Clone for ResourceRequest
impl Clone for ResourceRequest
Source§impl Debug for ResourceRequest
impl Debug for ResourceRequest
impl Eq for ResourceRequest
Source§impl PartialEq for ResourceRequest
impl PartialEq for ResourceRequest
impl StructuralPartialEq for ResourceRequest
Auto Trait Implementations§
impl Freeze for ResourceRequest
impl RefUnwindSafe for ResourceRequest
impl Send for ResourceRequest
impl Sync for ResourceRequest
impl Unpin for ResourceRequest
impl UnsafeUnpin for ResourceRequest
impl UnwindSafe for ResourceRequest
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