Struct HistoryAuthor
pub struct HistoryAuthor {
pub name: String,
pub avatar_hue: f32,
pub identity_short: String,
pub relation: AuthorRelation,
pub attribution: Option<HistoryAttribution>,
/* private fields */
}Expand description
Not crypto material — just enough metadata to render a per-author colour dot, display name, and a short identity hash for disambiguation when two authors share a name.
Fields§
§name: String§avatar_hue: f32Degrees [0, 360). Kept for fixtures and any surface that still
reads hue; paint uses HistoryAuthor::rgb.
identity_short: StringShort hex fragment of the identity pubkey; the producer decides the length, the widget treats it as an opaque label.
relation: AuthorRelationWho the author is to whoever reads the history: themselves, another person, or software acting for someone.
attribution: Option<HistoryAttribution>Who acted and for whom, when the author is an agent, a Shortcut or an
app acting for a person: the same facts Self::name reads as a
sentence, kept as data for the action surface and assistive tech.
Implementations§
§impl HistoryAuthor
impl HistoryAuthor
pub fn new( name: impl Into<String>, avatar_hue: f32, identity_short: impl Into<String>, ) -> HistoryAuthor
pub fn with_relation(self, relation: AuthorRelation) -> HistoryAuthor
pub fn with_attribution(self, attribution: HistoryAttribution) -> HistoryAuthor
pub fn with_attribution(self, attribution: HistoryAttribution) -> HistoryAuthor
Record who acted and for whom.
pub fn with_rgb(self, rgb: (u8, u8, u8)) -> HistoryAuthor
pub fn with_rgb(self, rgb: (u8, u8, u8)) -> HistoryAuthor
Use this exact RGB for the avatar, cursor and history row.
pub fn rgb(&self) -> (u8, u8, u8)
Trait Implementations§
§impl Clone for HistoryAuthor
impl Clone for HistoryAuthor
§fn clone(&self) -> HistoryAuthor
fn clone(&self) -> HistoryAuthor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HistoryAuthor
impl Debug for HistoryAuthor
§impl PartialEq for HistoryAuthor
impl PartialEq for HistoryAuthor
impl StructuralPartialEq for HistoryAuthor
Auto Trait Implementations§
impl Freeze for HistoryAuthor
impl RefUnwindSafe for HistoryAuthor
impl Send for HistoryAuthor
impl Sync for HistoryAuthor
impl Unpin for HistoryAuthor
impl UnsafeUnpin for HistoryAuthor
impl UnwindSafe for HistoryAuthor
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more