Skip to main content

FontBytes

Enum FontBytes 

Source
pub enum FontBytes {
    Static(&'static [u8]),
    Owned(Vec<u8>),
}
Expand description

The bytes a typeface is read from.

Variants§

§

Static(&'static [u8])

Bytes that live as long as the process, such as an embedded font or a font file read once: the typeface reads them in place.

§

Owned(Vec<u8>)

Bytes the typeface takes over.

Implementations§

Source§

impl FontBytes

Source

pub fn as_slice(&self) -> &[u8] ⓘ

The font file’s bytes.

Trait Implementations§

Source§

impl<const N: usize> From<&'static [u8; N]> for FontBytes

Source§

fn from(bytes: &'static [u8; N]) -> Self

Converts to this type from the input type.
Source§

impl From<&'static [u8]> for FontBytes

Source§

fn from(bytes: &'static [u8]) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for FontBytes

Source§

fn from(bytes: Vec<u8>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Forget for FontBytes

§

impl Freeze for FontBytes
where &'static [u8]: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for FontBytes

§

impl RefUnwindSafe for FontBytes

§

impl Send for FontBytes
where &'static [u8]: Send, RawVecInner: Send,

§

impl Sync for FontBytes
where RawVecInner: Sync,

§

impl Unpin for FontBytes
where &'static [u8]: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for FontBytes
where &'static [u8]: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

§

impl UnwindSafe for FontBytes
where &'static [u8]: UnwindSafe, RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.