third_party/rust/icu_provider/src/baked.rs
author Dave Townsend <dtownsend@oxymoronical.com>
Mon, 14 Jul 2025 14:08:24 +0000 (8 hours ago)
changeset 796524 2ef57d67fd0616c054a8e385c6b76d6342e81f75
parent 792559 59c51c0d8f5da56bd8d46451ae59a9f2de0774bd
permissions -rw-r--r--
Bug 1975002: Ensure we fully decode images before trying to use them in the Dock or Taskbar. r=profiles-reviewers,niklas Differential Revision: https://phabricator.services.mozilla.com/D256996
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! This module contains scaffolding for baked providers, typically generated using
//! databake.
//!
//! It can be glob-imported, and includes the icu_provider prelude.
//!
//! This needs the `"baked"` feature to be enabled.

pub mod zerotrie;
use crate::prelude::{DataIdentifierBorrowed, DataMarker, DataPayload};

/// A backing store for baked data
pub trait DataStore<M: DataMarker>: private::Sealed {
    /// Get the value for a key
    fn get(
        &self,
        req: DataIdentifierBorrowed,
        attributes_prefix_match: bool,
    ) -> Option<DataPayload<M>>;

    /// The type returned by the iterator
    #[cfg(feature = "alloc")]
    type IterReturn: Iterator<Item = crate::prelude::DataIdentifierCow<'static>>;
    /// Iterate over all data
    #[cfg(feature = "alloc")]
    fn iter(&'static self) -> Self::IterReturn;
}

pub(crate) mod private {
    pub trait Sealed {}
}