rtlibs-tui 0.1.5

rtools library: ratatui widgets
Documentation
#[derive(Debug)]
pub struct ScrollService
{
    pub text: Option<String>,
}

impl Default for ScrollService
{
    fn default() -> Self
    {
        Self::new()
    }
}

impl ScrollService
{
    pub fn new() -> Self
    {
        Self { text: None }
    }

    pub fn set_content<S>(
        &mut self,
        content: S,
    ) where
        S: AsRef<str>,
    {
        let mut inner = move |content: &str| {
            self.text = Some(content.to_string());
        };

        inner(content.as_ref())
    }
}