pub enum ResourceRef {
Inline(Bytes),
Base64 {
data: String,
},
File {
path: Utf8PathBuf,
},
Url {
url: Url,
},
ContentAddress {
hash: String,
},
}Variants§
Implementations§
Source§impl ResourceRef
impl ResourceRef
pub fn inline(data: impl Into<Bytes>) -> Self
pub fn base64(data: impl Into<String>) -> Self
pub fn file(path: impl Into<Utf8PathBuf>) -> Self
pub fn url(url: Url) -> Self
pub fn content_address(hash: impl Into<String>) -> Self
pub fn is_inline(&self) -> bool
pub fn is_remote(&self) -> bool
pub fn is_local(&self) -> bool
Trait Implementations§
Source§impl Clone for ResourceRef
impl Clone for ResourceRef
Source§fn clone(&self) -> ResourceRef
fn clone(&self) -> ResourceRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceRef
impl Debug for ResourceRef
Source§impl<'de> Deserialize<'de> for ResourceRef
impl<'de> Deserialize<'de> for ResourceRef
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 ResourceRef
impl RefUnwindSafe for ResourceRef
impl Send for ResourceRef
impl Sync for ResourceRef
impl Unpin for ResourceRef
impl UnwindSafe for ResourceRef
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