pub struct ImageProps {
pub src: String,
pub alt: String,
pub fit: ImageFit,
pub radius: ImageRadius,
pub loading: ImageLoading,
pub invert_on_dark: bool,
pub width: Option<String>,
pub height: Option<String>,
pub onload: Option<EventHandler<ImageEvent>>,
pub onerror: Option<EventHandler<ImageEvent>>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for Image.
Fields§
§src: StringImage URL.
alt: StringAlternative text. Use an empty string for decorative images.
fit: ImageFitHow the image fills its box.
radius: ImageRadiusCorner radius.
loading: ImageLoadingLoading strategy. Lazy by default.
invert_on_dark: boolInverts the image in dark themes, for black line art and logos.
width: Option<String>Intrinsic width in pixels, for the width attribute.
height: Option<String>Intrinsic height in pixels, for the height attribute.
onload: Option<EventHandler<ImageEvent>>Called when the image loads.
onerror: Option<EventHandler<ImageEvent>>Called when the image fails to load.
class: Option<String>Extra classes appended after the Lumen classes.
attributes: Vec<Attribute>Any other <img> or global attribute, such as srcset or sizes.
Implementations§
Source§impl ImageProps
impl ImageProps
Sourcepub fn builder() -> ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ImageProps.
On the builder, call .src(...), .alt(...), .fit(...)(optional), .radius(...)(optional), .loading(...)(optional), .invert_on_dark(...)(optional), .width(...)(optional), .height(...)(optional), .onload(...)(optional), .onerror(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ImageProps.
Trait Implementations§
Source§impl Clone for ImageProps
impl Clone for ImageProps
Source§impl PartialEq for ImageProps
impl PartialEq for ImageProps
Source§impl Properties for ImagePropswhere
Self: Clone,
impl Properties for ImagePropswhere
Self: Clone,
Source§type Builder = ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for ImageProps
Auto Trait Implementations§
impl !RefUnwindSafe for ImageProps
impl !Send for ImageProps
impl !Sync for ImageProps
impl !UnwindSafe for ImageProps
impl Forget for ImageProps
impl Freeze for ImageProps
impl Move for ImageProps
impl Unpin for ImageProps
impl UnsafeUnpin for ImagePropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<Event<ImageData>, ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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