#[non_exhaustive]pub enum Emit {
Both,
Module,
Catalogs,
Native,
NativeFiles,
}Expand description
What a build writes (plans/05-tooling.md §4; owner question 1 of
plans/12-phase-5a-work-order.md).
Every locale change rewrites a catalog, and a catalog is named by its content hash, so a build that writes both puts a new name in the generated module — and cargo recompiles the i18n crate and everything that depends on it, in both of cargo-leptos’ builds.
Splitting the two takes that cost away from the client: the i18n crate
emits Emit::Module, which editing a translation’s text never changes,
and a crate only the server binary depends on emits Emit::Catalogs.
(A translation that introduces a function the source does not use still
moves the manifest hash, and must — see [crate::manifest].)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Both
The manifest, the catalogs and a module that names them (the default: one crate, one build script).
Module
The manifest and a module with no catalog name, hash or byte in it.
Catalogs
The catalogs and the table that embeds them, for a server-only crate.
Native
For a native application (mf2::native): the manifest, the catalogs,
and a module that formats through the native host, with nothing
behind ssr and one CORPUS value that embeds the catalogs.
NativeFiles
As Emit::Native, but the catalogs are only written to the output
directory — the application ships them and loads them from a
directory — and CORPUS names their files without embedding them.
Trait Implementations§
impl Copy for Emit
impl Eq for Emit
impl StructuralPartialEq for Emit
Auto Trait Implementations§
impl Freeze for Emit
impl RefUnwindSafe for Emit
impl Send for Emit
impl Sync for Emit
impl Unpin for Emit
impl UnsafeUnpin for Emit
impl UnwindSafe for Emit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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