pub struct DataSet {
pub agora_data_set: u32,
pub title: String,
pub description: String,
pub compiled_by: String,
pub repo: String,
pub commit: GitCommitId,
pub index: DataFilePath,
pub files: Vec<DataFile>,
}Expand description
The data of a data_set entry. See the module docs.
Unknown keys are tolerated, as on a record: a stored manifest also
carries the writer’s _blind.
Fields§
§agora_data_set: u32Always DATA_SET_VERSION
title: String§description: StringWhat the data is, where it came from and how to read it (markdown)
compiled_by: StringWho compiled it, in their own words
repo: StringThe data repository’s name, as it is cloned (agora-data)
commit: GitCommitIdThe commit every file is read at
index: DataFilePathThe file a reader should open first; one of files
files: Vec<DataFile>Every file a server may serve, sorted by path
Implementations§
Source§impl DataSet
impl DataSet
Sourcepub fn validate(&self) -> Result<(), &'static str>
pub fn validate(&self) -> Result<(), &'static str>
What a writer refuses to sign: another version, a blank text field, no files, paths out of order or repeated, an index that is not listed, or a note that is blank or more than one line
Sourcepub fn file(&self, path: &DataFilePath) -> Option<&DataFile>
pub fn file(&self, path: &DataFilePath) -> Option<&DataFile>
The listed file at path, if it is listed
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Every file’s size, added up
Sourcepub fn under(&self, prefix: &str) -> (u64, u64)
pub fn under(&self, prefix: &str) -> (u64, u64)
The files under prefix (a directory ending in /): how many, and
their bytes added up
Sourcepub fn resolve(
&self,
asked: &str,
) -> Result<DataSetTarget<'_>, DataSetLookupError>
pub fn resolve( &self, asked: &str, ) -> Result<DataSetTarget<'_>, DataSetLookupError>
What attachment=<asked> names: a listed file, or a directory
(ending in /). Paths are relative to the repository root; one
relative to a directory at the root (README.md for
votes/README.md, the way a set’s own files cite each other)
resolves when exactly one directory holds it, and the target says
what was asked (asked is set only then). Surrounding whitespace
and a leading ./ or / are ignored. (0.91.4)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataSet
impl<'de> Deserialize<'de> for DataSet
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>,
impl Eq for DataSet
impl StructuralPartialEq for DataSet
Auto Trait Implementations§
impl Freeze for DataSet
impl RefUnwindSafe for DataSet
impl Send for DataSet
impl Sync for DataSet
impl Unpin for DataSet
impl UnsafeUnpin for DataSet
impl UnwindSafe for DataSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.