pub fn with_capacity(
        leader: &'static str,
        continued_leader: &'static str,
        capacity: usize,
        path: Option<PathBuf>,
    ) -> Self {
        let should_persist = path.is_some();

        let mut repl = Self {
            history: History::with_capacity(capacity, path),
            leader,
            attached: None,
            leader_len: leader.chars().count(),
            module: None,
            module_len: 0,
            continued_leader,
            continued_leader_len: leader.chars().count(),
            clear_keyword: "clear",
            _lang_interface: PhantomData,
            event_stream: EventStream::new(),
            lines: Vec::new(),
            c: Cursor::default(),
        };

        if should_persist {
            let _ = repl.history.read_from_file();
        }

        repl
    }
/// Create a `Repl` with specified language interface, and specified history capacity.
Create a `Repl` with specified language interface, and specified history capacity.
Create a ` Repl ` with specified language interface and specified history capacity .
pub fn with_capacity(
        leader: &'static str,
        continued_leader: &'static str,
        capacity: usize,
        path: Option<PathBuf>,
    ) -> Self {
        let should_persist = path.is_some();
        let mut repl = Self {
            history: History::with_capacity(capacity, path),
            leader,
            attached: None,
            leader_len: leader.chars().count(),
            module: None,
            module_len: 0,
            continued_leader,
            continued_leader_len: leader.chars().count(),
            clear_keyword: "clear",
            _lang_interface: PhantomData,
            event_stream: EventStream::new(),
            lines: Vec::new(),
            c: Cursor::default(),
        };
        if should_persist {
            let _ = repl.history.read_from_file();
        }
        repl
    }
pub fn with_capacity ( leader : & ' static str , continued_leader : & ' static str , capacity : usize , path : Option < PathBuf > , ) -> Self { let should_persist = path . is_some ( ) ; let mut repl = Self { history : History :: with_capacity ( capacity , path ) , leader , attached : None , leader_len : leader . chars ( ) . count ( ) , module : None , module_len : 0 , continued_leader , continued_leader_len : leader . chars ( ) . count ( ) , clear_keyword : " " , _lang_interface : PhantomData , event_stream : EventStream :: new ( ) , lines : Vec :: new ( ) , c : Cursor :: default ( ) , } ; if should_persist { let _ = repl . history . read_from_file ( ) ; } repl }
Create a `Repl` with specified language interface, and specified history capacity.
Create a ` Repl ` with specified language interface and specified history capacity .
leader
&'static str
continued_leader
&'static str
capacity
usize
path
Option<PathBuf>
leader
&'static str
continued_leader
&'static str
capacity
usize
path
Option<PathBuf>