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]

Create a new instance.

Example

let name = "My Cool Application";
let builder = Manifest::builder(name);

Finalize the builder and create the manifest.

Example

let name = "My Cool Application";
let manifest = Manifest::builder(name).build()?;

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()?;

Set the start_url value.

Example

let name = "My Cool Application";
let manifest = Manifest::builder(name)
  .start_url(".")
  .build()?;

Set the display value.

Example

let name = "My Cool Application";
let manifest = Manifest::builder(name)
  .display_mode(DisplayMode::Standalone)
  .build()?;

Set the background_color value.

Example

let name = "My Cool Application";
let manifest = Manifest::builder(name)
  .background_color("#000")
  .build()?;

Set the description value.

Example

let name = "My Cool Application";
let desc = "It does many things.";
let manifest = Manifest::builder(name)
  .description(desc)
  .build()?;

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]

Formats the value using the given formatter. Read more

impl<'s, 'i, 'r> Clone for Manifest<'s, 'i, 'r>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'s, 'i, 'r> Send for Manifest<'s, 'i, 'r>

impl<'s, 'i, 'r> Sync for Manifest<'s, 'i, 'r>