Struct fluent_fallback::types::ResourceId
source · pub struct ResourceId {
pub value: String,
pub resource_type: ResourceType,
}
Expand description
A resource identifier for a localization resource.
Fields
value: String
The resource identifier.
resource_type: ResourceType
The ResourceType
for this resource.
The default value (when converting from another type) is
ResourceType::Required
. You should only set this to
ResourceType::Optional
for experimental or under-development
features that may not yet have content in all eventually-supported locales.
Setting this value to ResourceType::Optional
for all resources
may have a severe impact on performance due to increasing the state space
of the solver.
Implementations
sourceimpl ResourceId
impl ResourceId
pub fn new<S: Into<String>>(value: S, resource_type: ResourceType) -> Self
sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Returns true
if the resource has ResourceType::Required
,
otherwise returns false
.
sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Returns true
if the resource has ResourceType::Optional
,
otherwise returns false
.
Trait Implementations
sourceimpl Clone for ResourceId
impl Clone for ResourceId
sourcefn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ResourceId
impl Debug for ResourceId
sourceimpl Display for ResourceId
impl Display for ResourceId
sourceimpl<S: Into<String>> From<S> for ResourceId
impl<S: Into<String>> From<S> for ResourceId
sourceimpl Hash for ResourceId
impl Hash for ResourceId
sourceimpl PartialEq<ResourceId> for ResourceId
impl PartialEq<ResourceId> for ResourceId
impl Eq for ResourceId
Auto Trait Implementations
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnwindSafe for ResourceId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more