pub struct TextDocumentContract {
pub id: String,
pub text: String,
pub language: Option<String>,
pub timestamp: Option<TimestampContract>,
pub attributes: BTreeMap<String, String>,
pub source: Option<TextSourceRef>,
pub provenance: Vec<TextProvenance>,
pub annotations: Vec<TextAnnotationSpan>,
}Fields§
§id: String§text: String§language: Option<String>§timestamp: Option<TimestampContract>§attributes: BTreeMap<String, String>§source: Option<TextSourceRef>§provenance: Vec<TextProvenance>§annotations: Vec<TextAnnotationSpan>Implementations§
Source§impl TextDocumentContract
impl TextDocumentContract
pub fn new(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn from_segment_contract(segment: &TextSegmentContract) -> Self
pub fn to_text_segment_contract( &self, segment_index: u64, ) -> TextSegmentContract
Trait Implementations§
Source§impl Clone for TextDocumentContract
impl Clone for TextDocumentContract
Source§fn clone(&self) -> TextDocumentContract
fn clone(&self) -> TextDocumentContract
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextDocumentContract
impl Debug for TextDocumentContract
Source§impl<'de> Deserialize<'de> for TextDocumentContract
impl<'de> Deserialize<'de> for TextDocumentContract
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OwnedTextDocument> for TextDocumentContract
impl From<OwnedTextDocument> for TextDocumentContract
Source§fn from(value: OwnedTextDocument) -> Self
fn from(value: OwnedTextDocument) -> Self
Converts to this type from the input type.
Source§impl From<TextDocument<'_>> for TextDocumentContract
impl From<TextDocument<'_>> for TextDocumentContract
Source§fn from(value: TextDocument<'_>) -> Self
fn from(value: TextDocument<'_>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TextDocumentContract
impl PartialEq for TextDocumentContract
Source§fn eq(&self, other: &TextDocumentContract) -> bool
fn eq(&self, other: &TextDocumentContract) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextDocumentContract
impl Serialize for TextDocumentContract
impl StructuralPartialEq for TextDocumentContract
Auto Trait Implementations§
impl Freeze for TextDocumentContract
impl RefUnwindSafe for TextDocumentContract
impl Send for TextDocumentContract
impl Sync for TextDocumentContract
impl Unpin for TextDocumentContract
impl UnsafeUnpin for TextDocumentContract
impl UnwindSafe for TextDocumentContract
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
Mutably borrows from an owned value. Read more