pub enum Base64OrRaw {
B64(String),
Raw(Vec<u8>),
}Expand description
Base64 is necessary because there are a lot of JS issues surrounding
ArrayBuffer / Uint8Buffer / ByteArray type mismatches, so a simple
atob / btoa fixes that at the cost of slight performance decrease.
Note: this enum is untagged, so from JS you can pass in either the base64 bytes or the bytearray and it’ll work.
Variants§
Implementations§
Source§impl Base64OrRaw
impl Base64OrRaw
Trait Implementations§
Source§impl Clone for Base64OrRaw
impl Clone for Base64OrRaw
Source§impl Debug for Base64OrRaw
impl Debug for Base64OrRaw
Source§impl Default for Base64OrRaw
impl Default for Base64OrRaw
Source§impl<'de> Deserialize<'de> for Base64OrRaw
impl<'de> Deserialize<'de> for Base64OrRaw
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 Base64OrRaw
impl PartialEq for Base64OrRaw
Source§impl Serialize for Base64OrRaw
impl Serialize for Base64OrRaw
impl StructuralPartialEq for Base64OrRaw
Auto Trait Implementations§
impl Forget for Base64OrRaw
impl Freeze for Base64OrRaw
impl Move for Base64OrRaw
impl RefUnwindSafe for Base64OrRaw
impl Send for Base64OrRaw
impl Sync for Base64OrRaw
impl Unpin for Base64OrRaw
impl UnsafeUnpin for Base64OrRaw
impl UnwindSafe for Base64OrRaw
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.