#[non_exhaustive]pub struct ImageSource(/* private fields */);
Available on crate feature
builder
only.Expand description
Image sourcing for embed images.
Implementations§
Source§impl ImageSource
impl ImageSource
Sourcepub fn attachment(
filename: impl AsRef<str>,
) -> Result<Self, ImageSourceAttachmentError>
pub fn attachment( filename: impl AsRef<str>, ) -> Result<Self, ImageSourceAttachmentError>
Create an attachment image source.
This will automatically prepend attachment://
to the source.
§Errors
Returns an ImageSourceAttachmentErrorType::ExtensionEmpty
if an
extension exists but is empty.
Returns an ImageSourceAttachmentErrorType::ExtensionMissing
if an
extension is missing.
Sourcepub fn url(url: impl Into<String>) -> Result<Self, ImageSourceUrlError>
pub fn url(url: impl Into<String>) -> Result<Self, ImageSourceUrlError>
Create a URL image source.
The following URL protocols are acceptable:
- https
- http
§Errors
Returns an ImageSourceUrlErrorType::ProtocolUnsupported
error type
if the URL’s protocol is unsupported.
Trait Implementations§
Source§impl Clone for ImageSource
impl Clone for ImageSource
Source§fn clone(&self) -> ImageSource
fn clone(&self) -> ImageSource
Returns a copy 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 ImageSource
impl Debug for ImageSource
Source§impl PartialEq for ImageSource
impl PartialEq for ImageSource
impl Eq for ImageSource
impl StructuralPartialEq for ImageSource
Auto Trait Implementations§
impl Freeze for ImageSource
impl RefUnwindSafe for ImageSource
impl Send for ImageSource
impl Sync for ImageSource
impl Unpin for ImageSource
impl UnwindSafe for ImageSource
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