[−][src]Struct geopattern::geo_pattern::GeoPattern
Methods
impl<'a> GeoPattern<'a>
[src]
pub fn new(s: &str) -> GeoPattern
[src]
This class uses the builder pattern for construction.
A string is mandatory, hence is a parameter for construction.
Rest of the options can be provided using static member functions.
calling build
finishes creating a new object.
pub fn color(self, color: Color) -> Self
[src]
sets color
pub fn base_color(self, base_color: Color) -> Self
[src]
sets base color
pub fn patterns(self, patterns: &'a [Patterns]) -> Self
[src]
sets patterns to use
pub fn build(self) -> Result<Self, GeoPatternError>
[src]
build internally builds the svg.
pub fn to_svg(&self) -> Result<&Document, GeoPatternError>
[src]
returns a reference to svg::Document, if one has been built. The returned reference can be used with svg crate's functions, like svg::save
pub fn to_minified_svg(&self) -> Result<String, GeoPatternError>
[src]
removes all the newlines from formatted svg::Document and returns it.
TODO: figure out if this is actually minified
pub fn to_data_uri(&self) -> Result<String, GeoPatternError>
[src]
creates a data URI (data:image/svg+xml;utf8,...) from the minified svg.
pub fn to_base64(&self) -> Result<String, GeoPatternError>
[src]
creates a base64 encoding of the minified svg.
pub fn to_base64_data_uri(&self) -> Result<String, GeoPatternError>
[src]
creates a data URI (data:image/svg+xml;base64,...) of a base64 encoded svg.
Trait Implementations
Auto Trait Implementations
impl<'a> !Send for GeoPattern<'a>
impl<'a> !Sync for GeoPattern<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,