pub struct Image { /* private fields */ }Implementations§
Source§impl Image
impl Image
pub fn new(src: impl Into<SharedString>) -> Self
pub fn empty() -> Self
pub fn src(self, src: impl Into<SharedString>) -> Self
pub fn file(self, path: impl Into<PathBuf>) -> Self
pub fn local(path: impl Into<PathBuf>) -> Self
pub fn alt(self, alt: impl Into<SharedString>) -> Self
pub fn width(self, width: impl Into<Pixels>) -> Self
pub fn height(self, height: impl Into<Pixels>) -> Self
pub fn size(self, width: impl Into<Pixels>, height: impl Into<Pixels>) -> Self
pub fn thumbnail(self) -> Self
pub fn thumbnail_sm(self) -> Self
pub fn square(self, size: impl Into<Pixels>) -> Self
pub fn square_lg(self) -> Self
pub fn fit(self, fit: ImageFit) -> Self
pub fn fill(self) -> Self
pub fn contain(self) -> Self
pub fn cover(self) -> Self
pub fn scale_down(self) -> Self
pub fn radius(self, radius: ImageRadius) -> Self
pub fn no_radius(self) -> Self
pub fn round(self) -> Self
pub fn round_options(self, options: ImageRoundOptions) -> Self
pub fn round_ring(self, ring: ImageRing) -> Self
pub fn round_sleeve(self) -> Self
pub fn bordered(self, bordered: bool) -> Self
pub fn no_border(self) -> Self
pub fn shadow(self, shadow: bool) -> Self
pub fn grayscale(self, grayscale: bool) -> Self
pub fn preview(self, preview: bool) -> Self
pub fn placeholder<E>(self, placeholder: impl Fn() -> E + 'static) -> Selfwhere
E: IntoElement,
pub fn fallback<E>(self, fallback: impl Fn() -> E + 'static) -> Selfwhere
E: IntoElement,
pub fn fit_kind(&self) -> ImageFit
pub fn radius_kind(&self) -> ImageRadius
pub fn round_config(&self) -> ImageRoundOptions
pub fn dimensions(&self) -> (Option<Pixels>, Option<Pixels>)
pub fn source(&self) -> Option<&ImageSource>
pub fn preview_enabled(&self) -> bool
Trait Implementations§
Source§impl IntoElement for Image
impl IntoElement for Image
Source§type Element = Component<Image>
type Element = Component<Image>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl RenderOnce for Image
impl RenderOnce for Image
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render this component into an element tree. Note that this method
takes ownership of self, as compared to
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for Image
impl !Send for Image
impl !Sync for Image
impl !UnwindSafe for Image
impl Freeze for Image
impl Unpin for Image
impl UnsafeUnpin for Image
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
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> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
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>
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