Struct freya_elements::elements::svg
source · pub struct svg;
Expand description
svg
element let’s you display SVG code.
You will need to use the bytes_to_data
to transform the bytes into data the element can recognize.
Example:
static FERRIS: &[u8] = include_bytes!("./ferris.svg");
fn app(cx: Scope) -> Element {
let ferris = bytes_to_data(cx, FERRIS);
render!(
svg {
svg_data: ferris,
}
)
}
Implementations§
source§impl svg
impl svg
sourcepub const margin: AttributeDescription = _
pub const margin: AttributeDescription = _
margin
Specify the margin of an element. You can do so by three different ways, just like in CSS.
fn app(cx: Scope) -> Element {
render!(
rect {
margin: "25" // 25 in all sides
margin: "100 50" // 100 in top and bottom, and 50 in left and right
margin: "5 7 3 9" 5 // in top, 7 in right, 3 in bottom and 9 in left
}
)
}
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 svg_data: AttributeDescription = _
pub const svg_content: 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 svg
impl Send for svg
impl Sync for svg
impl Unpin for svg
impl UnwindSafe for svg
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.