pub enum GifSource {
Uri(Uri),
Path(PathBuf),
Bytes(&'static str, Bytes),
}Available on crate feature
gif only.Expand description
§URI
Good to load remote GIFs.
Needs the
remote-assetfeature enabled.
let source: GifSource =
"https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExeXh5YWhscmo0YmF3OG1oMmpnMzBnbXFjcDR5Y2xoODE2ZnRpc2FhZiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/HTZVeK0esRjyw/giphy.gif"
.into();§Path
Good for dynamic loading.
let source: GifSource = PathBuf::from("./examples/frog_typing.gif").into();§Raw bytes
Good for embedded GIFs.
let source: GifSource = (
"frog-typing",
include_bytes!("../../../examples/frog_typing.gif"),
)
.into();Variants§
Uri(Uri)
Remote GIF loaded from a URI.
Requires the remote-asset feature.
Path(PathBuf)
Bytes(&'static str, Bytes)
Implementations§
Trait Implementations§
impl StructuralPartialEq for GifSource
Auto Trait Implementations§
impl !Freeze for GifSource
impl RefUnwindSafe for GifSource
impl Send for GifSource
impl Sync for GifSource
impl Unpin for GifSource
impl UnwindSafe for GifSource
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§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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