pub struct LabelPolicy { /* private fields */ }Expand description
The labels a deployment gives its records.
Implementations§
Source§impl LabelPolicy
impl LabelPolicy
Sourcepub fn declare(
origin_system: Option<&str>,
categories: &BTreeMap<String, Vec<DeclaredLabel>>,
origins: &BTreeMap<String, Vec<DeclaredLabel>>,
map: &CategoryMap,
) -> Result<Self, LabelError>
pub fn declare( origin_system: Option<&str>, categories: &BTreeMap<String, Vec<DeclaredLabel>>, origins: &BTreeMap<String, Vec<DeclaredLabel>>, map: &CategoryMap, ) -> Result<Self, LabelError>
The policy that labels each category of categories and each origin
of origins as they say, each category read as
CategoryMap::category reads it, every other category with its own
code, and every other origin with its endpoint in origin_system,
when given.
§Errors
A LabelError for an origin system that is no absolute URI, a key
that names no category or names one twice, an empty or malformed
endpoint, an empty list, and a label that is refused.
Sourcepub fn label<'a>(
&self,
classified: &Classification,
origins: impl IntoIterator<Item = &'a str>,
) -> Labels
pub fn label<'a>( &self, classified: &Classification, origins: impl IntoIterator<Item = &'a str>, ) -> Labels
The labels of the record of an access classified as classified,
whose data came from the endpoints origins.
Trait Implementations§
Source§impl Clone for LabelPolicy
impl Clone for LabelPolicy
Source§impl Debug for LabelPolicy
impl Debug for LabelPolicy
Source§impl Default for LabelPolicy
impl Default for LabelPolicy
impl Eq for LabelPolicy
Source§impl PartialEq for LabelPolicy
impl PartialEq for LabelPolicy
impl StructuralPartialEq for LabelPolicy
Auto Trait Implementations§
impl Freeze for LabelPolicy
impl RefUnwindSafe for LabelPolicy
impl Send for LabelPolicy
impl Sync for LabelPolicy
impl Unpin for LabelPolicy
impl UnsafeUnpin for LabelPolicy
impl UnwindSafe for LabelPolicy
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