pub struct Text {
pub data: String,
pub entities: Option<TextEntities>,
}
Expand description
Represents a text with entities.
Fields§
§data: String
The actual UTF-8 text.
entities: Option<TextEntities>
Text entities.
Implementations§
Source§impl Text
impl Text
Sourcepub fn with_entities(self, value: TextEntities) -> Text
pub fn with_entities(self, value: TextEntities) -> Text
Sets a new list of entities.
§Arguments
value
- The list of special entities that appear in the text.
Sourcepub fn get_bot_commands(&self) -> Option<Vec<TextEntityBotCommand>>
pub fn get_bot_commands(&self) -> Option<Vec<TextEntityBotCommand>>
Returns the list of bot commands found in text.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Text
impl<'de> Deserialize<'de> for Text
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Text, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Text, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Text> for InputMessageContent
impl From<Text> for InputMessageContent
Source§fn from(value: Text) -> InputMessageContent
fn from(value: Text) -> InputMessageContent
Converts to this type from the input type.
Source§impl From<Text> for InputMessageContentText
impl From<Text> for InputMessageContentText
Source§fn from(value: Text) -> InputMessageContentText
fn from(value: Text) -> InputMessageContentText
Converts to this type from the input type.
Source§impl PartialOrd for Text
impl PartialOrd for Text
Source§impl Serialize for Text
impl Serialize for Text
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFromInput for Text
impl TryFromInput for Text
Source§type Error = Infallible
type Error = Infallible
An error when conversion failed.
Source§async fn try_from_input(
input: HandlerInput,
) -> Result<Option<Self>, Self::Error>
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Performs conversion. Read more
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