Enum Author
pub enum Author<'a> {
Person {
name: &'a str,
identity: &'a str,
avatar: Option<&'a ImageData>,
color: Option<AlphaColor<Srgb>>,
},
Agent {
name: &'a str,
for_person: Option<&'a str>,
color: AlphaColor<Srgb>,
},
Bot {
bot_name: &'a str,
installed_by: &'a str,
appearance: Option<&'a Appearance>,
linked: Option<&'a str>,
linked_color: Option<AlphaColor<Srgb>>,
image: Option<&'a ImageData>,
},
}Variants§
Person
A person, by name and identity (which picks their colour), with the picture they set, already decoded by the app’s image store.
Fields
color: Option<AlphaColor<Srgb>>Agent
An agent acting for a person.
Bot
An installed bot, by its name and installer, with the appearance it showed, the Tilo person its persona is linked to, and the image its tile shows (the appearance’s avatar, else the bot’s icon).
Fields
appearance: Option<&'a Appearance>linked_color: Option<AlphaColor<Srgb>>The linked person’s own colour, which the tile wears when it shows no picture: one person has one colour on every surface, whether they write in the workspace or through a bridge.
Implementations§
§impl<'a> Author<'a>
impl<'a> Author<'a>
pub fn shown_name(&self) -> &'a str
pub fn is_bot(&self) -> bool
pub fn label(&self, members: &[&str]) -> String
pub fn label(&self, members: &[&str]) -> String
The shown name among the workspace’s current members: a bot’s
appearance that looks like one of them carries its persona’s service
(or, without one, the bot’s name).
pub fn service_mark(&self) -> Option<ServiceMark>
pub fn service_mark(&self) -> Option<ServiceMark>
The mark of the service a bridged person writes from, where the
toolkit has one: shown in place of the via Discord chip.
pub fn service_tip(&self) -> Option<String>
pub fn service_tip(&self) -> Option<String>
What the service mark says when hovered or read out: where the
person is (From Discord), with their handle there when the persona
names one rather than a bare numeric account id.
pub fn chip_label(&self) -> Option<String>
pub fn chip_label(&self) -> Option<String>
What a bot’s chip reads: where a person it speaks for is from
(via Discord) when its appearance is a persona on a service the
toolkit has no mark for, else that it is a bot. None for anyone
else, and for a persona whose service shows its mark instead.
pub fn details(&self) -> Option<String>
pub fn details(&self) -> Option<String>
What the chip says about a bot: the name it showed, the bot and who added it.
pub fn linked_line(&self) -> Option<String>
pub fn linked_line(&self) -> Option<String>
The profile line for a persona linked to a Tilo person; the author is still the bot.
pub fn layout(
&self,
members: &[&str],
origin: Point,
max_width: f64,
text: &mut TextRenderer,
theme: &Theme,
) -> AuthorLine
pub fn layout( &self, members: &[&str], origin: Point, max_width: f64, text: &mut TextRenderer, theme: &Theme, ) -> AuthorLine
Lay the author out in one line from origin, at most max_width
wide. A bot’s chip is placed first, so only the name gives way.
pub fn paint(&self, line: &AuthorLine, ctx: &mut PaintCtx<'_>)
pub fn paint(&self, line: &AuthorLine, ctx: &mut PaintCtx<'_>)
Paint a line Self::layout placed.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Author<'a>
impl<'a> !RefUnwindSafe for Author<'a>
impl<'a> Send for Author<'a>
impl<'a> Sync for Author<'a>
impl<'a> Unpin for Author<'a>
impl<'a> UnsafeUnpin for Author<'a>
impl<'a> !UnwindSafe for Author<'a>
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
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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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