pub struct Annotation {
pub audience: Option<Vec<Role>>,
pub priority: Option<f32>,
pub timestamp: Option<DateTime<Utc>>,
}Fields§
§audience: Option<Vec<Role>>§priority: Option<f32>§timestamp: Option<DateTime<Utc>>Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new_with_priority(priority: f32) -> Self
pub fn new_with_priority(priority: f32) -> Self
Create annotations with a given priority and the current timestamp.
Sourcepub fn new_with_audience(audience: Vec<Role>) -> Self
pub fn new_with_audience(audience: Vec<Role>) -> Self
Create annotations with a given audience and the current timestamp.
Sourcepub fn new_with_priority_and_audience(
priority: f32,
audience: Vec<Role>,
) -> Self
pub fn new_with_priority_and_audience( priority: f32, audience: Vec<Role>, ) -> Self
Create annotations with a given priority and audience, and the current timestamp.
pub fn set_priority(&mut self, priority: f32)
Sourcepub fn set_audience(&mut self, audience: Vec<Role>)
pub fn set_audience(&mut self, audience: Vec<Role>)
设置新的受众角色
Sourcepub fn update_timestamp(&mut self)
pub fn update_timestamp(&mut self)
更新时间戳为当前时间
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a duplicate of the value. Read more
1.0.0 · 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 Annotation
impl Debug for Annotation
Source§impl Default for Annotation
impl Default for Annotation
Source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
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 PartialEq for Annotation
impl PartialEq for Annotation
Source§impl Serialize for Annotation
impl Serialize for Annotation
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnwindSafe for Annotation
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