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§
Source§impl 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§
Source§impl Clone for ResourceId
impl Clone for ResourceId
Source§fn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
Returns a copy of the value. Read more
1.0.0 · 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 ResourceId
impl Debug for ResourceId
Source§impl Display for ResourceId
impl Display for ResourceId
Source§impl Hash for ResourceId
impl Hash for ResourceId
Source§impl PartialEq<str> for ResourceId
impl PartialEq<str> for ResourceId
Source§impl PartialEq for ResourceId
impl PartialEq for ResourceId
impl Eq for ResourceId
Auto Trait Implementations§
impl Freeze for ResourceId
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnwindSafe for ResourceId
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