pub struct FzfBuilder { /* private fields */ }
Expand description
Builder for Fzf
.
Implementations§
Source§impl FzfBuilder
impl FzfBuilder
Sourcepub fn literal<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn literal<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Do not normalize latin script letters before matching
Sourcepub fn track<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn track<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Track the current selection when the result is updated
Sourcepub fn tac<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn tac<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Reverse the order of the input
Sourcepub fn keep_right<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn keep_right<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Keep the right end of the line visible on overflow
Sourcepub fn no_hscroll<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn no_hscroll<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Disable horizontal scroll
Sourcepub fn filepath_word<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn filepath_word<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Make word-wise movements respect path separators
Sourcepub fn layout<VALUE: Into<Layout>>(&mut self, value: VALUE) -> &mut Self
pub fn layout<VALUE: Into<Layout>>(&mut self, value: VALUE) -> &mut Self
Choose layout
Examples found in repository?
examples/color.rs (line 11)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn border<VALUE: Into<Border>>(&mut self, value: VALUE) -> &mut Self
pub fn border<VALUE: Into<Border>>(&mut self, value: VALUE) -> &mut Self
Draw border around the finder
Examples found in repository?
examples/color.rs (line 12)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn border_label<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn border_label<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Label to print on the border
Examples found in repository?
examples/color.rs (line 13)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn no_separator<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn no_separator<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Hide info line separator
Sourcepub fn no_scrollbar<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn no_scrollbar<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Hide scrollbar
Sourcepub fn prompt<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn prompt<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Input prompt (default: ’> ’)
Sourcepub fn pointer<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn pointer<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Pointer to the current line (default: ‘>’)
Sourcepub fn header<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn header<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
String to print as header
Examples found in repository?
examples/color.rs (line 15)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn header_first<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn header_first<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Print header before the prompt line
Examples found in repository?
examples/color.rs (line 16)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn ansi<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn ansi<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Enable processing of ANSI color codes
Sourcepub fn tabstop<VALUE: Into<u8>>(&mut self, value: VALUE) -> &mut Self
pub fn tabstop<VALUE: Into<u8>>(&mut self, value: VALUE) -> &mut Self
Number of spaces for a tab character (default: 8)
Sourcepub fn color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self
pub fn color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self
Base scheme (dark|light|16|bw)
Examples found in repository?
examples/color.rs (line 14)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Sourcepub fn build(&self) -> Result<Fzf, FzfBuilderError>
pub fn build(&self) -> Result<Fzf, FzfBuilderError>
Examples found in repository?
examples/color.rs (line 18)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Source§impl FzfBuilder
impl FzfBuilder
Sourcepub fn custom_args(
&mut self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn custom_args( &mut self, args: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Additional arguments that this library doesn’t currently support as a predefined option
Examples found in repository?
examples/color.rs (line 17)
5fn main() {
6 let colours = vec![
7 "red", "orange", "yellow", "green", "blue", "indigo", "violet",
8 ];
9
10 let fzf = Fzf::builder()
11 .layout(Layout::Reverse)
12 .border(Border::Rounded)
13 .border_label("Favourite Colour")
14 .color(Color::Bw)
15 .header("Pick your favourite colour")
16 .header_first(true)
17 .custom_args(vec!["--height=10".to_string()])
18 .build()
19 .unwrap();
20
21 let users_selection = run_with_output(fzf, colours);
22
23 if let Some(colour) = users_selection {
24 println!("{} is an awesome colour!", colour);
25 }
26}
Trait Implementations§
Source§impl Clone for FzfBuilder
impl Clone for FzfBuilder
Source§fn clone(&self) -> FzfBuilder
fn clone(&self) -> FzfBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FzfBuilder
impl RefUnwindSafe for FzfBuilder
impl Send for FzfBuilder
impl Sync for FzfBuilder
impl Unpin for FzfBuilder
impl UnwindSafe for FzfBuilder
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