pub struct ModuleResourceSpec {
pub key: ResourceKey,
pub locale_relative_path: LocaleRelativeFtlPath,
pub required: bool,
}Expand description
Canonical description of a single localized resource file.
Fields§
§key: ResourceKeyStable resource key used by managers (e.g., my-crate, my-crate/ui, my-crate/ui/button).
locale_relative_path: LocaleRelativeFtlPathPath under a locale root (e.g., my-crate.ftl, my-crate/ui.ftl, my-crate/ui/button.ftl).
required: boolWhether this resource is required for locale readiness.
Implementations§
Source§impl ModuleResourceSpec
impl ModuleResourceSpec
Sourcepub fn try_new(
key: impl Into<String>,
locale_relative_path: impl Into<String>,
required: bool,
) -> Result<ModuleResourceSpec, ResourcePlanError>
pub fn try_new( key: impl Into<String>, locale_relative_path: impl Into<String>, required: bool, ) -> Result<ModuleResourceSpec, ResourcePlanError>
Validates and creates a resource specification.
Sourcepub fn new(
key: ResourceKey,
locale_relative_path: LocaleRelativeFtlPath,
required: bool,
) -> ModuleResourceSpec
pub fn new( key: ResourceKey, locale_relative_path: LocaleRelativeFtlPath, required: bool, ) -> ModuleResourceSpec
Creates a resource specification from validated parts.
Sourcepub fn try_base(
domain: &str,
required: bool,
) -> Result<ModuleResourceSpec, ResourcePlanError>
pub fn try_base( domain: &str, required: bool, ) -> Result<ModuleResourceSpec, ResourcePlanError>
Validates and creates the base domain resource specification.
Sourcepub fn base(domain: &str, required: bool) -> ModuleResourceSpec
pub fn base(domain: &str, required: bool) -> ModuleResourceSpec
Creates the base domain resource specification.
Sourcepub fn base_for_static_domain(
domain: StaticFluentDomain,
required: bool,
) -> ModuleResourceSpec
pub fn base_for_static_domain( domain: StaticFluentDomain, required: bool, ) -> ModuleResourceSpec
Creates the base domain resource specification from a validated static domain.
Sourcepub fn try_namespaced(
domain: &str,
namespace: &ResolvedNamespace,
required: bool,
) -> Result<ModuleResourceSpec, ResourcePlanError>
pub fn try_namespaced( domain: &str, namespace: &ResolvedNamespace, required: bool, ) -> Result<ModuleResourceSpec, ResourcePlanError>
Validates and creates a namespaced resource specification.
Sourcepub fn namespaced(
domain: &str,
namespace: &ResolvedNamespace,
required: bool,
) -> ModuleResourceSpec
pub fn namespaced( domain: &str, namespace: &ResolvedNamespace, required: bool, ) -> ModuleResourceSpec
Creates a namespaced resource specification.
Sourcepub fn namespaced_for_static_domain(
domain: StaticFluentDomain,
namespace: &ResolvedNamespace,
required: bool,
) -> ModuleResourceSpec
pub fn namespaced_for_static_domain( domain: StaticFluentDomain, namespace: &ResolvedNamespace, required: bool, ) -> ModuleResourceSpec
Creates a namespaced resource specification from validated static metadata.
Sourcepub fn locale_path(&self, lang: &LanguageIdentifier) -> String
pub fn locale_path(&self, lang: &LanguageIdentifier) -> String
Returns the full path for a locale (e.g., en/my-crate.ftl).
Trait Implementations§
Source§impl Clone for ModuleResourceSpec
impl Clone for ModuleResourceSpec
Source§fn clone(&self) -> ModuleResourceSpec
fn clone(&self) -> ModuleResourceSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more