pub enum Text {
Mrkdwn(Contents),
Plain(Contents),
}Expand description
Variants§
Implementations§
Source§impl Text
impl Text
Sourcepub fn builder() -> TextBuilderInit
pub fn builder() -> TextBuilderInit
Build a new Text object
See TextBuilder for example
Sourcepub fn copy_from<T: Into<Self> + Clone>(contents: &T) -> Self
pub fn copy_from<T: Into<Self> + Clone>(contents: &T) -> Self
Clone the data behind a reference, then convert it into
a Text
§Arguments
contents- Anything that can be cloned into a type that is convertable to aText- this includes thePlainandMrkdwncontents structs. Notably, this doesn’t include a conversion directly from a reference to aStringor a&str- that’s because assuming which kind of text a string represents could lead to unexpected behavior when that kind of text isn’t valid.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Text
impl<'de> Deserialize<'de> for Text
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 From<Text> for ImageOrText<'static>
impl From<Text> for ImageOrText<'static>
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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