[−][src]Struct unsegen::base::style::TextFormatModifier
Specifies how to modify a text format value.
Fields
bold: BoolModifyMode
italic: BoolModifyMode
invert: BoolModifyMode
underline: BoolModifyMode
Implementations
impl TextFormatModifier
[src]
pub fn new() -> Self
[src]
Construct a new (not actually) modifier, that leaves all properties unchanged.
pub fn bold<M: Into<BoolModifyMode>>(self, val: M) -> Self
[src]
Set the bold property of the TextFormatModifier
Examples:
use unsegen::base::{TextFormatModifier, BoolModifyMode}; assert_eq!(TextFormatModifier::new().bold(BoolModifyMode::Toggle).bold, BoolModifyMode::Toggle);
pub fn italic<M: Into<BoolModifyMode>>(self, val: M) -> Self
[src]
Set the italic property of the TextFormatModifier
Examples:
use unsegen::base::{TextFormatModifier, BoolModifyMode}; assert_eq!(TextFormatModifier::new().italic(BoolModifyMode::True).italic, BoolModifyMode::True);
pub fn invert<M: Into<BoolModifyMode>>(self, val: M) -> Self
[src]
Set the invert property of the TextFormatModifier
Examples:
use unsegen::base::{TextFormatModifier, BoolModifyMode}; assert_eq!(TextFormatModifier::new().invert(BoolModifyMode::False).invert, BoolModifyMode::False);
pub fn underline<M: Into<BoolModifyMode>>(self, val: M) -> Self
[src]
Set underline invert property of the TextFormatModifier
Examples:
use unsegen::base::{TextFormatModifier, BoolModifyMode}; assert_eq!(TextFormatModifier::new().underline(BoolModifyMode::LeaveUnchanged).underline, BoolModifyMode::LeaveUnchanged);
pub fn on_top_of(self, other: TextFormatModifier) -> Self
[src]
Combine the current value with that of the argument so that the application of the returned value is always equivalent to first applying other and then applying self to some TextFormat.
Examples:
use unsegen::base::{TextFormatModifier, TextFormat, BoolModifyMode}; let mut f1 = TextFormat::default(); let mut f2 = f1; let m1 = TextFormatModifier::new().italic(BoolModifyMode::Toggle).bold(true).underline(false); let m2 = TextFormatModifier::new().italic(true).bold(false); m1.on_top_of(m2).modify(&mut f1); m2.modify(&mut f2); m1.modify(&mut f2); assert_eq!(f1, f2);
pub fn modify(self, format: &mut TextFormat)
[src]
Modify the passed textformat according to the modification rules of self.
Trait Implementations
impl Clone for TextFormatModifier
[src]
fn clone(&self) -> TextFormatModifier
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for TextFormatModifier
[src]
impl Debug for TextFormatModifier
[src]
impl Default for TextFormatModifier
[src]
impl Eq for TextFormatModifier
[src]
impl PartialEq<TextFormatModifier> for TextFormatModifier
[src]
fn eq(&self, other: &TextFormatModifier) -> bool
[src]
fn ne(&self, other: &TextFormatModifier) -> bool
[src]
impl StructuralEq for TextFormatModifier
[src]
impl StructuralPartialEq for TextFormatModifier
[src]
Auto Trait Implementations
impl RefUnwindSafe for TextFormatModifier
impl Send for TextFormatModifier
impl Sync for TextFormatModifier
impl Unpin for TextFormatModifier
impl UnwindSafe for TextFormatModifier
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,