pub enum ImageReference {
None,
Path(SmolStr),
Url(Url),
DataUri(SmolStr),
EmbeddedData {
resource_id: EmbeddedResourcesIdx,
extension: String,
},
EmbeddedTexture {
resource_id: EmbeddedResourcesIdx,
},
}Variants§
None
Path(SmolStr)
An absolute path to a local image file on disk.
Url(Url)
A non-data: URL, e.g. builtin:/, http(s):, or user://.
DataUri(SmolStr)
An inline data: URI carrying the image content.
EmbeddedData
EmbeddedTexture
Fields
§
resource_id: EmbeddedResourcesIdxImplementations§
Source§impl ImageReference
impl ImageReference
Sourcepub fn from_resolved(reference: SmolStr) -> Self
pub fn from_resolved(reference: SmolStr) -> Self
Classify a resolved @image-url string (an absolute path, a URL, or a
data: URI) into the matching reference kind.
Sourcepub fn from_mapped_url(url: Url) -> Self
pub fn from_mapped_url(url: Url) -> Self
Classify a URL returned by the resource mapper. It is already a URL, so
the only distinction is a data: URI (kept as a string, see
Self::DataUri) from any other URL.
Trait Implementations§
Source§impl Clone for ImageReference
impl Clone for ImageReference
Source§impl Debug for ImageReference
impl Debug for ImageReference
Source§impl Display for ImageReference
Available on crate feature cpp only.
impl Display for ImageReference
Available on crate feature
cpp only.Source§impl ToTokens for ImageReference
Available on crate feature rust only.
impl ToTokens for ImageReference
Available on crate feature
rust only.Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for ImageReference
impl RefUnwindSafe for ImageReference
impl Send for ImageReference
impl Sync for ImageReference
impl Unpin for ImageReference
impl UnsafeUnpin for ImageReference
impl UnwindSafe for ImageReference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more