Struct twilight_util::builder::embed::image_source::ImageSource
source · #[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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)