[−][src]Struct cursive::views::TextContent
Provides access to the content of a TextView
.
Cloning this object will still point to the same content.
Examples
let mut content = TextContent::new("content"); let view = TextView::new_with_content(content.clone()); // Later, possibly in a different thread content.set_content("new content"); assert!(view.get_content().source().contains("new"));
Methods
impl TextContent
[src]
pub fn new<S>(content: S) -> Self where
S: Into<StyledString>,
[src]
S: Into<StyledString>,
Creates a new text content around the given value.
Parses the given value.
impl TextContent
[src]
pub fn set_content<S>(&mut self, content: S) where
S: Into<StyledString>,
[src]
S: Into<StyledString>,
Replaces the content with the given value.
pub fn append<S>(&mut self, content: S) where
S: Into<StyledString>,
[src]
S: Into<StyledString>,
Append content
to the end of a TextView
.
pub fn get_content(&self) -> TextContentRef
[src]
Returns a reference to the content.
This locks the data while the returned value is alive, so don't keep it too long.
Trait Implementations
impl Clone for TextContent
[src]
fn clone(&self) -> TextContent
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for TextContent
impl Sync for TextContent
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,