pub struct Text { /* private fields */ }Expand description
Bionic Reading converted text.
Can be used in its raw form (as HTML) or Markdown.
Implementations§
Source§impl Text
impl Text
Sourcepub fn html(&self) -> Option<String>
pub fn html(&self) -> Option<String>
Get content as HTML.
Once you have the response:
let response = Client::new("api_key")
.convert("Lorem ipsum dolor sit amet")
.send()
.await?;Then it can be turned into HTML.
assert_eq!(response.html().unwrap(), "<b>Lor</b>em <b>ips</b>um <b>dol</b>or <b>si</b>t <b>ame</b>t");Sourcepub fn markdown(&self) -> Option<String>
pub fn markdown(&self) -> Option<String>
Get content as Markdown, converted from HTML.
Once you have the response:
let response = Client::new("api_key")
.convert("Lorem ipsum dolor sit amet")
.send()
.await?;Then it can be turned into Markdown.
assert_eq!(response.markdown().unwrap(), "**Lor**em **ips**um **dol**or **si**t **ame**t");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