Struct freya_elements::elements::image
source · pub struct image;
Expand description
image
element let’s you show an image.
Example:
static RUST_LOGO: &[u8] = include_bytes!("./rust_logo.png");
fn app(cx: Scope) -> Element {
let image_data = bytes_to_data(cx, RUST_LOGO);
render!(
image {
image_data: image_data,
width: "{size}",
height: "{size}",
}
)
}
Implementations§
source§impl image
impl image
sourcepub const height: AttributeDescription = _
pub const height: AttributeDescription = _
width and height
Specify the width and height for the given element.
See syntax in Size Units
.
Example:
fn app(cx: Scope) -> Element {
render!(
rect {
background: "red",
width: "15",
height: "50",
}
)
}
pub const width: AttributeDescription = _
pub const image_data: AttributeDescription = _
pub const image_reference: AttributeDescription = _
pub const role: AttributeDescription = _
pub const focus_id: AttributeDescription = _
pub const alt: AttributeDescription = _
pub const name: AttributeDescription = _
pub const focusable: AttributeDescription = _
Auto Trait Implementations§
impl RefUnwindSafe for image
impl Send for image
impl Sync for image
impl Unpin for image
impl UnwindSafe for image
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