pub struct TextSegmentContract {
pub stream_id: Option<String>,
pub segment_index: u64,
pub text: String,
pub language: Option<String>,
pub timestamp: Option<TimestampContract>,
pub duration_seconds: Option<f64>,
pub is_final: bool,
pub attributes: BTreeMap<String, String>,
pub source: Option<TextSourceRef>,
pub provenance: Vec<TextProvenance>,
pub annotations: Vec<TextAnnotationSpan>,
}Fields§
§stream_id: Option<String>§segment_index: u64§text: String§language: Option<String>§timestamp: Option<TimestampContract>§duration_seconds: Option<f64>§is_final: bool§attributes: BTreeMap<String, String>§source: Option<TextSourceRef>§provenance: Vec<TextProvenance>§annotations: Vec<TextAnnotationSpan>Implementations§
Source§impl TextSegmentContract
impl TextSegmentContract
pub fn new(segment_index: u64, text: impl Into<String>) -> Self
pub fn document_id(&self) -> Option<String>
pub fn to_owned_text_segment(&self) -> OwnedTextSegment
pub fn to_text_document_contract(&self) -> TextDocumentContract
pub fn from_document_contract( document: &TextDocumentContract, segment_index: u64, ) -> Self
Trait Implementations§
Source§impl Clone for TextSegmentContract
impl Clone for TextSegmentContract
Source§fn clone(&self) -> TextSegmentContract
fn clone(&self) -> TextSegmentContract
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 TextSegmentContract
impl Debug for TextSegmentContract
Source§impl<'de> Deserialize<'de> for TextSegmentContract
impl<'de> Deserialize<'de> for TextSegmentContract
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<OwnedTextSegment> for TextSegmentContract
impl From<OwnedTextSegment> for TextSegmentContract
Source§fn from(value: OwnedTextSegment) -> Self
fn from(value: OwnedTextSegment) -> Self
Converts to this type from the input type.
Source§impl From<TextSegment<'_>> for TextSegmentContract
impl From<TextSegment<'_>> for TextSegmentContract
Source§fn from(value: TextSegment<'_>) -> Self
fn from(value: TextSegment<'_>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TextSegmentContract
impl PartialEq for TextSegmentContract
Source§fn eq(&self, other: &TextSegmentContract) -> bool
fn eq(&self, other: &TextSegmentContract) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextSegmentContract
impl Serialize for TextSegmentContract
impl StructuralPartialEq for TextSegmentContract
Auto Trait Implementations§
impl Freeze for TextSegmentContract
impl RefUnwindSafe for TextSegmentContract
impl Send for TextSegmentContract
impl Sync for TextSegmentContract
impl Unpin for TextSegmentContract
impl UnsafeUnpin for TextSegmentContract
impl UnwindSafe for TextSegmentContract
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