Struct noline::builder::EditorBuilder
source · pub struct EditorBuilder<B: Buffer, H: History> { /* private fields */ }Expand description
Builder for sync::Editor and no_sync::tokio::Editor.
§Example
use noline::builder::EditorBuilder;
let mut editor = EditorBuilder::new_static::<100>()
.with_static_history::<200>()
.build_sync(&mut io)
.unwrap();Implementations§
source§impl EditorBuilder<NoBuffer, NoHistory>
impl EditorBuilder<NoBuffer, NoHistory>
sourcepub fn new_static<const N: usize>() -> EditorBuilder<StaticBuffer<N>, NoHistory>
pub fn new_static<const N: usize>() -> EditorBuilder<StaticBuffer<N>, NoHistory>
Create builder for editor with static buffer
§Example
use noline::builder::EditorBuilder;
let builder = EditorBuilder::new_static::<100>();sourcepub fn new_unbounded() -> EditorBuilder<UnboundedBuffer, NoHistory>
pub fn new_unbounded() -> EditorBuilder<UnboundedBuffer, NoHistory>
Create builder for editor with unbounded buffer
§Example
use noline::builder::EditorBuilder;
let builder = EditorBuilder::new_unbounded();source§impl<B: Buffer, H: History> EditorBuilder<B, H>
impl<B: Buffer, H: History> EditorBuilder<B, H>
sourcepub fn with_static_history<const N: usize>(
self,
) -> EditorBuilder<B, StaticHistory<N>>
pub fn with_static_history<const N: usize>( self, ) -> EditorBuilder<B, StaticHistory<N>>
Add static history
sourcepub fn with_unbounded_history(self) -> EditorBuilder<B, UnboundedHistory>
pub fn with_unbounded_history(self) -> EditorBuilder<B, UnboundedHistory>
Add unbounded history
sourcepub fn build_sync<IO, RE, WE>(
self,
io: &mut IO,
) -> Result<Editor<B, H, IO>, Error<RE, WE>>
pub fn build_sync<IO, RE, WE>( self, io: &mut IO, ) -> Result<Editor<B, H, IO>, Error<RE, WE>>
Build sync::Editor. Is equivalent of calling sync::Editor::new().
sourcepub async fn build_async_tokio<W: AsyncWriteExt + Unpin, R: AsyncReadExt + Unpin>(
self,
stdin: &mut R,
stdout: &mut W,
) -> Result<Editor<B, H>, Error<Error, Error>>
pub async fn build_async_tokio<W: AsyncWriteExt + Unpin, R: AsyncReadExt + Unpin>( self, stdin: &mut R, stdout: &mut W, ) -> Result<Editor<B, H>, Error<Error, Error>>
Build no_sync::tokio::Editor. Is equivalent of calling no_sync::tokio::Editor::new().
Auto Trait Implementations§
impl<B, H> Freeze for EditorBuilder<B, H>
impl<B, H> RefUnwindSafe for EditorBuilder<B, H>where
B: RefUnwindSafe,
H: RefUnwindSafe,
impl<B, H> Send for EditorBuilder<B, H>
impl<B, H> Sync for EditorBuilder<B, H>
impl<B, H> Unpin for EditorBuilder<B, H>
impl<B, H> UnwindSafe for EditorBuilder<B, H>where
B: UnwindSafe,
H: UnwindSafe,
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