# Value in maplibre::tile - Rust
Variant type encoding The use of values is described in section 4.1 of the specification

# Struct maplibre::tile::Value

    pub struct Value {
        pub string_value: Option<String>,
        pub float_value: Option<f32>,
        pub double_value: Option<f64>,
        pub int_value: Option<i64>,
        pub uint_value: Option<u64>,
        pub sint_value: Option<i64>,
        pub bool_value: Option<bool>,
    }

Expand description

Variant type encoding The use of values is described in section 4.1 of the specification

## Fields§

§ `string_value: Option<String>`

Exactly one of these values must be present in a valid message

§ `float_value: Option<f32>` § `double_value: Option<f64>` § `int_value: Option<i64>` § `uint_value: Option<u64>` § `sint_value: Option<i64>` § `bool_value: Option<bool>`

## Implementations§

§

### impl Value

#### pub fn string_value(&self) -> &str

Returns the value of `string_value`, or the default value if `string_value` is unset.

#### pub fn float_value(&self) -> f32

Returns the value of `float_value`, or the default value if `float_value` is unset.

#### pub fn double_value(&self) -> f64

Returns the value of `double_value`, or the default value if `double_value` is unset.

#### pub fn int_value(&self) -> i64

Returns the value of `int_value`, or the default value if `int_value` is unset.

#### pub fn uint_value(&self) -> u64

Returns the value of `uint_value`, or the default value if `uint_value` is unset.

#### pub fn sint_value(&self) -> i64

Returns the value of `sint_value`, or the default value if `sint_value` is unset.

#### pub fn bool_value(&self) -> bool

Returns the value of `bool_value`, or the default value if `bool_value` is unset.

## Trait Implementations§

§

### impl Clone for Value

§

#### fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source §

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more
§

### impl Debug for Value

§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

### impl Default for Value

§

#### fn default() -> Value

Returns the “default value” for a type. Read more
§

### impl From<TileValue> for Value

§

#### fn from(tv: TileValue) -> Value

Converts to this type from the input type.
§

### impl Message for Value

§

#### fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
§

#### fn clear(&mut self)

Clears the message, resetting all fields to their default.
source §

#### fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source §

#### fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source §

#### fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source §

#### fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source §

#### fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source §

#### fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source §

#### fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into `self`. Read more
source §

#### fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into `self`.
§

### impl PartialEq for Value

§

#### fn eq(&self, other: &Value) -> bool

This method tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 · source §

#### fn ne(&self, other: &Rhs) -> bool

This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

### impl StructuralPartialEq for Value

## Auto Trait Implementations§

§

### impl RefUnwindSafe for Value

§

### impl Send for Value

§

### impl Sync for Value

§

### impl Unpin for Value

§

### impl UnwindSafe for Value

## Blanket Implementations§

source §

### impl<T> Any for T
where T: 'static + ?Sized,

source §

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source §

### impl<T> Borrow<T> for T
where T: ?Sized,

source §

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source §

### impl<T> BorrowMut<T> for T
where T: ?Sized,

source §

#### fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

### impl<T> Downcast<T> for T

§

#### fn downcast(&self) -> &T

§

### impl<T> Downcast for T
where T: Any,

§

#### fn into_any(self: Box<T>) -> Box<dyn Any>

Convert `Box<dyn Trait>` (where `Trait: Downcast`) to `Box<dyn Any>`. `Box<dyn Any>` can then be further `downcast` into `Box<ConcreteType>` where `ConcreteType` implements `Trait`.
§

#### fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert `Rc<Trait>` (where `Trait: Downcast`) to `Rc<Any>`. `Rc<Any>` can then be further `downcast` into `Rc<ConcreteType>` where `ConcreteType` implements `Trait`.
§

#### fn as_any(&self) -> &(dyn Any + 'static)

Convert `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s.
§

#### fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert `&mut Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s.
§

### impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

#### fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert `Arc<Trait>` (where `Trait: Downcast`) to `Arc<Any>`. `Arc<Any>` can then be further `downcast` into `Arc<ConcreteType>` where `ConcreteType` implements `Trait`.
source §

### impl<T> From<T> for T

source §

#### fn from(t: T) -> T

Returns the argument unchanged.

§

### impl<T> Instrument for T

§

#### fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [`Span`], returning an `Instrumented` wrapper. Read more
§

#### fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current `Span`, returning an `Instrumented` wrapper. Read more
source §

### impl<T, U> Into<U> for T
where U: From<T>,

source §

#### fn into(self) -> U

Calls `U::from(self)`.

That is, this conversion is whatever the implementation of `From<T> for U` chooses to do.

source §

### impl<T> Same for T

§

#### type Output = T

Should always be `Self`
source §

### impl<T> ToOwned for T
where T: Clone,

§

#### type Owned = T

The resulting type after obtaining ownership.
source §

#### fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source §

#### fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source §

### impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

#### type Error = Infallible

The type returned in the event of a conversion error.
source §

#### fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source §

### impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source §

#### fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

### impl<T> Upcast<T> for T

§

#### fn upcast(&self) -> Option<&T>

§

### impl<T> WithSubscriber for T

§

#### fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided `Subscriber` to this type, returning a [`WithDispatch`] wrapper. Read more
§

#### fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default `Subscriber` to this type, returning a [`WithDispatch`] wrapper. Read more
§

### impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

§

#### fn is_within(&self, b: &G2) -> bool

source §

### impl<T> Resource for T
where T: 'static,

§

### impl<T> WasmNotSend for T
where T: Send,

§

### impl<T> WasmNotSync for T
where T: Sync,