[−][src]Struct webbundle::Builder
Methods
impl Builder
[src]
pub fn version(self, version: Version) -> Self
[src]
Sets the version.
pub fn primary_url(self, primary_url: Uri) -> Self
[src]
Sets the primary url.
pub fn manifest(self, manifest: Uri) -> Self
[src]
Sets the manifest url.
pub fn exchange(self, exchange: Exchange) -> Self
[src]
Adds the exchange.
pub fn exchanges_from_dir(
self,
dir: impl AsRef<Path>,
base_url: Url
) -> Result<Self>
[src]
self,
dir: impl AsRef<Path>,
base_url: Url
) -> Result<Self>
Append exchanges from the files under the given directory.
base_url
will be used as a prefix for each
resource. A relative path from the given directory to each
file is appended to base_url
.
Examples
let bundle = Bundle::builder() .version(Version::VersionB1) .primary_url("https://example.com/index.html".parse()?) .exchanges_from_dir("assets", "https://example.com".parse()?)? .build()?;
pub fn build(self) -> Result<Bundle>
[src]
Builds the bundle.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,