pub struct DataCitation {
pub set: GovernanceLogId,
pub commit: Option<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). The commit may be left out, the path
then written from the root with a leading /:
DATA-2026-0001:/<path> or DATA-2026-0001:/<path>:110-300, for the
commit the set pins as it stands (0.110.0).
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. One
without a commit reads the latest version, as the set’s own id does: it
is unambiguous today (a set pins exactly one commit) but follows any
revision, so the canonical citation, which a record should keep, names
the commit; the file read says which it was.
After the set’s id and its :, a citation is one of two forms
(Steward, 2026-10-20): <commit>:<path>, the commit 7 to 40 hex
digits, or /<path>, a path from the repository root with no commit.
Anything else is refused, naming both, so no path is ever taken for a
commit or a commit for a path. The parse lives here alone: the scheme
may change (a URL form may come with the get_content consolidation).
The path runs 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: Option<GitCommitPrefix>The commit cited, or None for the one the set pins as it stands
(0.110.0)
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; \
without a commit, for the one the set pins, the path starts with \
`/`: DATA-YYYY-NNNN:/<path> or DATA-YYYY-NNNN:/<path>:<from>-<to>. \
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; \ without a commit, for the one the set pins, the path starts with \ `/`: DATA-YYYY-NNNN:/<path> or DATA-YYYY-NNNN:/<path>:<from>-<to>. \ 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
Sourcepub fn reads_at(&self, commit: &GitCommitId) -> bool
pub fn reads_at(&self, commit: &GitCommitId) -> bool
true when this citation reads at commit: it names a prefix of
it, or no commit at all (0.110.0)
Sourcepub fn at(self, commit: impl Into<GitCommitPrefix>) -> Self
pub fn at(self, commit: impl Into<GitCommitPrefix>) -> Self
This citation naming commit, its canonical form once the commit a
commit-less one read at is known (0.110.0)
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 From<DataCitation> for AgoraLink
impl From<DataCitation> for AgoraLink
Source§fn from(citation: DataCitation) -> Self
fn from(citation: 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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
impl<T> PendingHandle for Twhere
T: Send + 'static,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more