pub enum Classification {
Public,
Private,
}Expand description
Who may read an item: anybody, or only those who may read where it is kept.
Two values, ordered so the stricter is the greater: strictest of
any two is the one an item they both describe carries. Nothing combines them any other
way, which is what makes an explicit public unable to loosen a private repository or a
private project — a classification only ever tightens.
It is recorded on the item and travels with it. A source whose backend has no notion of
its own records it under Self::METADATA_KEY, exactly as it records
Repository::METADATA_KEY, and only while it is private: an item without it is
public, so every item written before this existed reads as it did.
Variants§
Public
Anybody who may read the destination may read it.
Private
It may be written only to a destination verified private, and nothing of it may reach a public one.
Implementations§
Source§impl Classification
impl Classification
Sourcepub const METADATA_KEY: &'static str = "onetaskgraph.classification"
pub const METADATA_KEY: &'static str = "onetaskgraph.classification"
The reserved metadata key a source records a private classification under when its backend has no notion of its own.
Spelled once, here, for the reason Repository::METADATA_KEY is.
Sourcepub fn from_metadata(metadata: &BTreeMap<String, Value>) -> Result<Self, String>
pub fn from_metadata(metadata: &BTreeMap<String, Value>) -> Result<Self, String>
The classification a source records under Self::METADATA_KEY, or public when
it records none.
§Errors
Returns a message when the key holds anything but one of the two spellings.
Trait Implementations§
Source§impl Clone for Classification
impl Clone for Classification
impl Copy for Classification
Source§impl Debug for Classification
impl Debug for Classification
Source§impl Default for Classification
impl Default for Classification
Source§impl<'de> Deserialize<'de> for Classification
impl<'de> Deserialize<'de> for Classification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Classification
impl Display for Classification
impl Eq for Classification
Source§impl FromStr for Classification
impl FromStr for Classification
Source§impl Hash for Classification
impl Hash for Classification
Source§impl JsonSchema for Classification
impl JsonSchema for Classification
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more