pub struct SvgDocument { /* private fields */ }Expand description
A structure representing the outermost svg element of SVG document.
Implementations§
Source§impl SvgDocument
impl SvgDocument
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty SVG document.
§Example
use domrs::SvgDocument;
assert_eq!("<svg/>", SvgDocument::new().to_string());Sourcepub fn default_namespace(self) -> Self
pub fn default_namespace(self) -> Self
Sets the default SVG namespace.
Sourcepub fn set_default_namespace(&mut self)
pub fn set_default_namespace(&mut self)
Sets the default SVG namespace.
Sourcepub fn set_namespace<T: ToString>(&mut self, namespace: T)
pub fn set_namespace<T: ToString>(&mut self, namespace: T)
Sets custom SVG namespace.
Sourcepub fn view_box<T: Into<SvgNumber>>(
self,
min_x: T,
min_y: T,
width: T,
height: T,
) -> Self
pub fn view_box<T: Into<SvgNumber>>( self, min_x: T, min_y: T, width: T, height: T, ) -> Self
Sets the position and dimension, in user space, of an SVG viewport.
Sourcepub fn set_view_box<T: Into<SvgNumber>>(
&mut self,
min_x: T,
min_y: T,
width: T,
height: T,
)
pub fn set_view_box<T: Into<SvgNumber>>( &mut self, min_x: T, min_y: T, width: T, height: T, )
Sets the position and dimension, in user space, of an SVG viewport.
Sourcepub fn height<T: Into<SvgNumber>>(self, height: T) -> Self
pub fn height<T: Into<SvgNumber>>(self, height: T) -> Self
Sets the displayed height attribute.
Sourcepub fn set_height<T: Into<SvgNumber>>(&mut self, height: T)
pub fn set_height<T: Into<SvgNumber>>(&mut self, height: T)
Sets the displayed height attribute.
Trait Implementations§
Source§impl Clone for SvgDocument
impl Clone for SvgDocument
Source§fn clone(&self) -> SvgDocument
fn clone(&self) -> SvgDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SvgDocument
impl Debug for SvgDocument
Source§impl Default for SvgDocument
impl Default for SvgDocument
Source§fn default() -> SvgDocument
fn default() -> SvgDocument
Returns the “default value” for a type. Read more
Source§impl Display for SvgDocument
impl Display for SvgDocument
Source§impl From<SvgDocument> for HtmlElement
impl From<SvgDocument> for HtmlElement
Source§fn from(value: SvgDocument) -> Self
fn from(value: SvgDocument) -> Self
Creates HtmlElement from SvgDocument.
Auto Trait Implementations§
impl Freeze for SvgDocument
impl RefUnwindSafe for SvgDocument
impl Send for SvgDocument
impl Sync for SvgDocument
impl Unpin for SvgDocument
impl UnwindSafe for SvgDocument
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