pub struct Resource {
pub canonical_name: String,
pub kind: ResourceKind,
pub bytes: Vec<u8>,
}Expand description
A resolved resource consisting of its canonical name, kind, and raw bytes.
Fields§
§canonical_name: StringCanonical path or name under which this resource was resolved.
kind: ResourceKindKind of this resource.
bytes: Vec<u8>Raw bytes of the resource content.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn new(
canonical_name: impl Into<String>,
kind: ResourceKind,
bytes: impl Into<Vec<u8>>,
) -> Self
pub fn new( canonical_name: impl Into<String>, kind: ResourceKind, bytes: impl Into<Vec<u8>>, ) -> Self
Create a resource from its canonical name, kind, and bytes.
Sourcepub fn from_request(
request: &ResourceRequest,
bytes: impl Into<Vec<u8>>,
) -> Self
pub fn from_request( request: &ResourceRequest, bytes: impl Into<Vec<u8>>, ) -> Self
Build a resource from an existing request and the resolved bytes.
Trait Implementations§
impl Eq for Resource
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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