pub struct DiscussionReference {
pub kind: i32,
pub id: String,
pub at: Option<StateId>,
pub start: u32,
pub end: u32,
}Expand description
One entity a turn refers to (an @ mention as a resolvable reference,
not prose that happens to look like one). Shared by DiscussionTurn and
AppendTurnRequest (collaboration.proto imports this file).
Server validation (enforced at append; out of scope for this contract surface but documented here):
- reject [start, end) outside body, or overlapping another reference
- reject empty id
- reject
atset on a non-snapshot kind (USER/AGENT/SPOOL/THREAD/STATE)
Fields§
§kind: i32§id: StringStable identity of the referent — handle, full path, thread ref, change id. NEVER display text: a reference must survive a rename, so the label is resolved at render from current data.
at: Option<StateId>The state this reference was known-valid at. Set ONLY for
snapshot-relative kinds (FILE, LINE, SYMBOL): a path, a line number
and a symbol name are meaningless without a snapshot to read them
against. Absent on USER/AGENT/SPOOL/THREAD/STATE, which do not drift
this way. Clients/servers must not act on at for those kinds.
start: u32Byte offsets into body this reference occupies, so a client can
render it inline without re-parsing prose. Half-open [start, end).
end: u32Implementations§
Source§impl DiscussionReference
impl DiscussionReference
Sourcepub fn kind(&self) -> ReferenceKind
pub fn kind(&self) -> ReferenceKind
Returns the enum value of kind, or the default if the field is set to an invalid enum value.
Sourcepub fn set_kind(&mut self, value: ReferenceKind)
pub fn set_kind(&mut self, value: ReferenceKind)
Sets kind to the provided enum value.
Trait Implementations§
Source§impl Clone for DiscussionReference
impl Clone for DiscussionReference
Source§fn clone(&self) -> DiscussionReference
fn clone(&self) -> DiscussionReference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscussionReference
impl Debug for DiscussionReference
Source§impl Default for DiscussionReference
impl Default for DiscussionReference
impl Eq for DiscussionReference
Source§impl Hash for DiscussionReference
impl Hash for DiscussionReference
Source§impl Message for DiscussionReference
impl Message for DiscussionReference
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.