pub struct DataCitation {
pub set: GovernanceLogId,
pub commit: GitCommitPrefix,
pub path: DataFilePath,
pub lines: Option<LineRange>,
}Expand description
A data set’s file, cited at the commit it was read at, and optionally
lines of it: DATA-2026-0001:<commit>:<path>:110-300, or without the
range for the whole file (0.103).
get_content takes one as its id and reads that file (and those
lines). The commit is a prefix of at least seven hex digits of the
commit the data set pins. A server reads the set as revised (its latest
version) when the commit is the latest version’s, and as originally
signed when it is the original’s, so a citation made before any revision
keeps reading what it cited. One made at an intermediate revision’s
commit stops resolving once a later revision pins another commit.
The path runs from the second : to the end, or to the last : when
what follows that is a range written <from>-<to> or <from>-, so a
path may hold a :.
Fields§
§set: GovernanceLogIdA DATA-… id
commit: GitCommitPrefix§path: DataFilePath§lines: Option<LineRange>Implementations§
Source§impl DataCitation
impl DataCitation
Sourcepub const FORM: &'static str = "A data set's file is cited as \
DATA-YYYY-NNNN:<commit>:<path>, or \
DATA-YYYY-NNNN:<commit>:<path>:<from>-<to> for some of its lines; \
to read the data set itself, give its id alone."
pub const FORM: &'static str = "A data set's file is cited as \ DATA-YYYY-NNNN:<commit>:<path>, or \ DATA-YYYY-NNNN:<commit>:<path>:<from>-<to> for some of its lines; \ to read the data set itself, give its id alone."
How a citation is written, for error messages
Sourcepub fn is_citation_shaped(s: &str) -> bool
pub fn is_citation_shaped(s: &str) -> bool
true when s starts with a DATA-… id and a :, so it is meant
as a citation and its error is the one to show
Trait Implementations§
Source§impl Clone for DataCitation
impl Clone for DataCitation
Source§impl Debug for DataCitation
impl Debug for DataCitation
Source§impl Display for DataCitation
impl Display for DataCitation
impl Eq for DataCitation
Source§impl From<DataCitation> for ContentRef
impl From<DataCitation> for ContentRef
Source§fn from(c: DataCitation) -> Self
fn from(c: DataCitation) -> Self
Source§impl FromStr for DataCitation
impl FromStr for DataCitation
Source§impl Hash for DataCitation
impl Hash for DataCitation
Source§impl PartialEq for DataCitation
impl PartialEq for DataCitation
impl StructuralPartialEq for DataCitation
Auto Trait Implementations§
impl Freeze for DataCitation
impl RefUnwindSafe for DataCitation
impl Send for DataCitation
impl Sync for DataCitation
impl Unpin for DataCitation
impl UnsafeUnpin for DataCitation
impl UnwindSafe for DataCitation
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,
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.