// Copyright 2018-2019 Mozilla // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License.
use std::fmt;
use arrayref::array_ref; use bincode::{deserialize, serialize, serialized_size}; use ordered_float::OrderedFloat; use uuid::{Bytes, Uuid};
usecrate::error::DataError;
/// We define a set of types, associated with simple integers, to annotate values stored /// in the database. This is to avoid an accidental 'cast' from a value of one type to another. /// For this reason we don't simply use `deserialize` from the `bincode` crate. #[repr(u8)] #[derive(Debug, PartialEq, Eq)] pubenumType {
Bool = 1,
U64 = 2,
I64 = 3,
F64 = 4,
Instant = 5, // Millisecond-precision timestamp.
Uuid = 6,
Str = 7,
Json = 8,
Blob = 9,
}
/// We use manual tagging, because <https://github.com/serde-rs/serde/issues/610>. implType { pubfn from_tag(tag: u8) -> Result<Type, DataError> { #![allow(clippy::unnecessary_lazy_evaluations)] Type::from_primitive(tag).ok_or_else(|| DataError::UnknownType(tag))
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-10-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.