ratatui-toolkit 0.2.6

DEPRECATED: this crate was renamed to `ratkit`. Please migrate to `ratkit`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Source path method for SourceState.

use std::path::Path;

use crate::widgets::markdown_widget::state::source_state::SourceState;

impl SourceState {
    /// Get the file path if this is a file-based source.
    ///
    /// # Returns
    ///
    /// The file path, or `None` if this is a string source or no source is set.
    pub fn source_path(&self) -> Option<&Path> {
        self.source.as_ref().and_then(|s| s.path())
    }
}