pub struct StyledCow<'s> {
pub s: Cow<'s, str>,
pub style: Style,
pub link: Option<String>,
}Expand description
A Cow<'s, str> with a Style annotation.
§Example
use genpdfi_extended::style;
let ss1 = style::StyledCow::new("bold", style::Effect::Bold, None);
let ss2 = style::StyledCow::new("red".to_owned(), style::Color::Rgb(255, 0, 0), None);Fields§
§s: Cow<'s, str>The annotated string.
style: StyleThe style annotation.
link: Option<String>The link annotation.
Implementations§
Trait Implementations§
Source§impl<'s> From<&'s StyledString> for StyledCow<'s>
impl<'s> From<&'s StyledString> for StyledCow<'s>
Source§fn from(s: &'s StyledString) -> StyledCow<'s>
fn from(s: &'s StyledString) -> StyledCow<'s>
Converts to this type from the input type.
Source§impl<'s> From<StyledString> for StyledCow<'s>
impl<'s> From<StyledString> for StyledCow<'s>
Source§fn from(s: StyledString) -> StyledCow<'s>
fn from(s: StyledString) -> StyledCow<'s>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'s> Freeze for StyledCow<'s>
impl<'s> RefUnwindSafe for StyledCow<'s>
impl<'s> Send for StyledCow<'s>
impl<'s> Sync for StyledCow<'s>
impl<'s> Unpin for StyledCow<'s>
impl<'s> UnwindSafe for StyledCow<'s>
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,
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§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.