pub struct ResourcePlan { /* private fields */ }Expand description
Canonical resource plan for a module domain.
Implementations§
Source§impl ResourcePlan
impl ResourcePlan
Sourcepub fn sparse_from_assets(
domain: &str,
assets_root: &Path,
) -> Result<SparseAssetResourcePlans, SparseAssetResourcePlanError>
pub fn sparse_from_assets( domain: &str, assets_root: &Path, ) -> Result<SparseAssetResourcePlans, SparseAssetResourcePlanError>
Discovers sparse per-language resource plans from an assets tree.
assets_root must contain locale directories such as en-US/. Within
each locale, {domain}.ftl is the base resource and
{domain}/{namespace}.ftl entries are namespaced resources.
Source§impl ResourcePlan
impl ResourcePlan
Sourcepub fn for_static_domain(
domain: StaticFluentDomain,
namespaces: &[&str],
) -> Result<ResourcePlan, ResourcePlanError>
pub fn for_static_domain( domain: StaticFluentDomain, namespaces: &[&str], ) -> Result<ResourcePlan, ResourcePlanError>
Builds the global/default canonical resource plan for a validated static domain.
Sourcepub fn for_domain(
domain: &str,
namespaces: &[&str],
) -> Result<ResourcePlan, ResourcePlanError>
pub fn for_domain( domain: &str, namespaces: &[&str], ) -> Result<ResourcePlan, ResourcePlanError>
Builds the global/default canonical resource plan for a domain.
Sourcepub fn sparse_for_domain(
domain: &str,
has_base_resource: bool,
namespaces: &[ResolvedNamespace],
base_required: bool,
) -> ResourcePlan
pub fn sparse_for_domain( domain: &str, has_base_resource: bool, namespaces: &[ResolvedNamespace], base_required: bool, ) -> ResourcePlan
Builds a sparse resource plan for a single locale.
Sourcepub fn sparse_for_static_domain(
domain: StaticFluentDomain,
has_base_resource: bool,
namespaces: &[ResolvedNamespace],
base_required: bool,
) -> ResourcePlan
pub fn sparse_for_static_domain( domain: StaticFluentDomain, has_base_resource: bool, namespaces: &[ResolvedNamespace], base_required: bool, ) -> ResourcePlan
Builds a sparse resource plan for a single locale from validated static metadata.
Sourcepub fn specs(&self) -> &[ModuleResourceSpec]
pub fn specs(&self) -> &[ModuleResourceSpec]
Returns the resource specs in this plan.
Sourcepub fn into_specs(self) -> Vec<ModuleResourceSpec>
pub fn into_specs(self) -> Vec<ModuleResourceSpec>
Converts the plan into its resource specs.
Trait Implementations§
Source§impl Clone for ResourcePlan
impl Clone for ResourcePlan
Source§fn clone(&self) -> ResourcePlan
fn clone(&self) -> ResourcePlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourcePlan
impl Debug for ResourcePlan
impl Eq for ResourcePlan
Source§impl PartialEq for ResourcePlan
impl PartialEq for ResourcePlan
impl StructuralPartialEq for ResourcePlan
Auto Trait Implementations§
impl Freeze for ResourcePlan
impl RefUnwindSafe for ResourcePlan
impl Send for ResourcePlan
impl Sync for ResourcePlan
impl Unpin for ResourcePlan
impl UnsafeUnpin for ResourcePlan
impl UnwindSafe for ResourcePlan
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
Mutably borrows from an owned value. Read more