Struct webmanifest::Manifest [−][src]
pub struct Manifest<'s, 'i, 'r> { /* fields omitted */ }
Create a new manifest builder.
Methods
impl<'s, 'i, 'r> Manifest<'s, 'i, 'r>
[src]
impl<'s, 'i, 'r> Manifest<'s, 'i, 'r>
pub fn builder(name: &'s str) -> Self
[src]
pub fn builder(name: &'s str) -> Self
Create a new instance.
Example
let name = "My Cool Application"; let builder = Manifest::builder(name);
pub fn build(self) -> Result<String, Error>
[src]
pub fn build(self) -> Result<String, Error>
Finalize the builder and create the manifest.
Example
let name = "My Cool Application"; let manifest = Manifest::builder(name).build()?;
pub fn short_name(self, val: &'s str) -> Self
[src]
pub fn short_name(self, val: &'s str) -> Self
Set the short_name
value.
Panics
This will panic if the short name exceeds 12 characters.
Example
let name = "My Cool Application"; let manifest = Manifest::builder(name) .short_name("Cool App") .build()?;
pub fn start_url(self, val: &'s str) -> Self
[src]
pub fn start_url(self, val: &'s str) -> Self
Set the start_url
value.
Example
let name = "My Cool Application"; let manifest = Manifest::builder(name) .start_url(".") .build()?;
pub fn display_mode(self, val: DisplayMode) -> Self
[src]
pub fn display_mode(self, val: DisplayMode) -> Self
Set the display
value.
Example
let name = "My Cool Application"; let manifest = Manifest::builder(name) .display_mode(DisplayMode::Standalone) .build()?;
pub fn background_color(self, val: &'s str) -> Self
[src]
pub fn background_color(self, val: &'s str) -> Self
Set the background_color
value.
Example
let name = "My Cool Application"; let manifest = Manifest::builder(name) .background_color("#000") .build()?;
pub fn description(self, val: &'s str) -> Self
[src]
pub fn description(self, val: &'s str) -> Self
Set the description
value.
Example
let name = "My Cool Application"; let desc = "It does many things."; let manifest = Manifest::builder(name) .description(desc) .build()?;
pub fn icon(self, val: &'i Icon) -> Self
[src]
pub fn icon(self, val: &'i Icon) -> Self
Add an Icon
to the icons vector.
Example
let name = "My Cool Application"; let src = "images/touch/homescreen48.png"; let manifest = Manifest::builder(name) .icon(&Icon::new(&src, "48x48")) .build()?;
Add an Related
application to the related_applications
vector.
Example
let name = "My Cool Application"; let url = "https://play.google.com/store/apps/details?id=cheeaun.hackerweb"; let manifest = Manifest::builder(name) .related(&Related::new("play", url)) .build()?;
Trait Implementations
impl<'s, 'i, 'r> Debug for Manifest<'s, 'i, 'r>
[src]
impl<'s, 'i, 'r> Debug for Manifest<'s, 'i, 'r>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'s, 'i, 'r> Clone for Manifest<'s, 'i, 'r>
[src]
impl<'s, 'i, 'r> Clone for Manifest<'s, 'i, 'r>