pub struct LocalizedLabel { /* private fields */ }Expand description
Localized label text with explicit fallback.
Implementations§
Source§impl LocalizedLabel
impl LocalizedLabel
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty localized label.
Examples found in repository?
examples/layout_labels.rs (line 9)
3fn feature(
4 id: &str,
5 latitude: f64,
6 longitude: f64,
7 priority: LabelPriority,
8) -> Result<MapFeature, map_expressions::MapError> {
9 let mut label = LocalizedLabel::new();
10 label.insert("ja", id)?;
11 MapFeature::new(
12 id,
13 GeoPoint::new(latitude, longitude)?,
14 label,
15 priority,
16 0,
17 20,
18 )
19}Sourcepub fn insert(
&mut self,
language: impl Into<String>,
value: impl Into<String>,
) -> Result<(), MapError>
pub fn insert( &mut self, language: impl Into<String>, value: impl Into<String>, ) -> Result<(), MapError>
Adds or replaces a non-blank language and label value.
Examples found in repository?
examples/layout_labels.rs (line 10)
3fn feature(
4 id: &str,
5 latitude: f64,
6 longitude: f64,
7 priority: LabelPriority,
8) -> Result<MapFeature, map_expressions::MapError> {
9 let mut label = LocalizedLabel::new();
10 label.insert("ja", id)?;
11 MapFeature::new(
12 id,
13 GeoPoint::new(latitude, longitude)?,
14 label,
15 priority,
16 0,
17 20,
18 )
19}Trait Implementations§
Source§impl Clone for LocalizedLabel
impl Clone for LocalizedLabel
Source§impl Debug for LocalizedLabel
impl Debug for LocalizedLabel
Source§impl Default for LocalizedLabel
impl Default for LocalizedLabel
impl Eq for LocalizedLabel
Source§impl PartialEq for LocalizedLabel
impl PartialEq for LocalizedLabel
impl StructuralPartialEq for LocalizedLabel
Auto Trait Implementations§
impl Freeze for LocalizedLabel
impl RefUnwindSafe for LocalizedLabel
impl Send for LocalizedLabel
impl Sync for LocalizedLabel
impl Unpin for LocalizedLabel
impl UnsafeUnpin for LocalizedLabel
impl UnwindSafe for LocalizedLabel
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