Skip to main content

BuildOptions

Struct BuildOptions 

Source
pub struct BuildOptions {
Show 13 fields pub app_dir: PathBuf, pub entry: String, pub css: CssStrategy, pub dom: DomStrategy, pub plugin: Option<Plugin>, pub components: Vec<String>, pub component_asset_roots: Vec<String>, pub metafile: bool, pub css_file_name_template: String, pub css_public_base: Option<String>, pub legal_comments: LegalComments, pub theme: Option<TokenFile>, pub projection_manifests: Vec<ProjectionManifestSource>,
}
Expand description

Options for building a WebUI application.

Fields§

§app_dir: PathBuf

Path to the application folder containing templates.

§entry: String

Entry HTML file name (e.g., "index.html").

§css: CssStrategy

CSS delivery strategy for component stylesheets.

§dom: DomStrategy

DOM strategy for component rendering (shadow or light).

§plugin: Option<Plugin>

Framework plugin to load.

§components: Vec<String>

Additional component sources (npm packages or local paths).

§component_asset_roots: Vec<String>

Additional root components to compile for static component asset emission.

These roots are parsed into the protocol so their templates, styles, and dependency closures can be emitted later, but they are not connected to the entry fragment and therefore are not rendered during initial SSR.

§metafile: bool

Whether to serialize an esbuild-compatible component asset metafile.

§css_file_name_template: String

Emitted asset filename template using [name], [hash], and [ext].

Applies to Link-mode CSS files and static component assets.

§css_public_base: Option<String>

Optional URL/base-path prefix for Link-mode css_href values. When set, emitted protocol hrefs become <base>/<filename>.

§legal_comments: LegalComments

Legal comment preservation strategy.

§theme: Option<TokenFile>

Optional loaded design-token theme used to validate discovered CSS tokens.

When present, every discovered CSS token that remains unresolved after local and ancestor CSS definitions are removed must exist in every theme, unless the var() usage supplies a literal CSS fallback (e.g. var(--x, 16px)), which provides its own value. Missing required tokens fail the build as parser diagnostics.

§projection_manifests: Vec<ProjectionManifestSource>

Bundler-neutral state projection manifest fragments supplied as disk paths or inline JSON with a logical manifest path.

Empty (the default) means projection is disabled: the build emits webui_protocol::InitialStateStrategy::Full and every scripted component keeps a full-state (All) partial-navigation surface. No JavaScript/TypeScript analysis ever runs in Rust.

When non-empty, every manifest is loaded, hash-validated against the files it declares, merged by component tag, and used to narrow each scripted component that is actually compiled into the protocol down to an exact hydration/navigation key surface. Every such scripted component must have exactly one manifest entry, or the build fails with WebUIError::Projection (PROJ-B001). Supplying manifests with a plugin other than Plugin::WebUI fails the build immediately (PROJ-B002): only the WebUI plugin produces protocol fields compatible with per-component key encoding.

Manifests are read only at build time. The runtime handler never opens a manifest file; the compiled protocol is fully self-contained.

Trait Implementations§

Source§

impl Clone for BuildOptions

Source§

fn clone(&self) -> BuildOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BuildOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BuildOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.