pub struct KeycapLabel {
pub glyph: Glyph,
pub text: String,
pub size: f32,
pub origin: [f32; 2],
}Fields§
§glyph: Glyph§text: String§size: f32§origin: [f32; 2]Implementations§
Source§impl KeycapLabel
impl KeycapLabel
pub fn key( engine: &mut TextEngine, face: &Face, labels: &KeyLabels, key: Key, ) -> Result<Self, Error>
pub fn key_with_floor( engine: &mut TextEngine, face: &Face, labels: &KeyLabels, key: Key, floor: f32, ) -> Result<Self, Error>
pub fn fit( engine: &mut TextEngine, face: &Face, text: &str, ) -> Result<Self, Error>
pub fn fit_with_floor( engine: &mut TextEngine, face: &Face, text: &str, floor: f32, ) -> Result<Self, Error>
pub fn place( &self, engine: &mut TextEngine, face: &Face, color: [f32; 4], origin: [f32; 2], height: f32, placement: &Placement, ) -> Result<Placed, Error>
Trait Implementations§
Source§impl Clone for KeycapLabel
impl Clone for KeycapLabel
Source§fn clone(&self) -> KeycapLabel
fn clone(&self) -> KeycapLabel
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 KeycapLabel
impl Debug for KeycapLabel
Source§impl PartialEq for KeycapLabel
impl PartialEq for KeycapLabel
Source§fn eq(&self, other: &KeycapLabel) -> bool
fn eq(&self, other: &KeycapLabel) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for KeycapLabel
Auto Trait Implementations§
impl Freeze for KeycapLabel
impl RefUnwindSafe for KeycapLabel
impl Send for KeycapLabel
impl Sync for KeycapLabel
impl Unpin for KeycapLabel
impl UnsafeUnpin for KeycapLabel
impl UnwindSafe for KeycapLabel
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.