Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 #![forbid(unsafe_code)]
2
3 mod listrust-analyzer cargo tui-react 0.24.0 list/;
4 mod terminalrust-analyzer cargo tui-react 0.24.0 terminal/;
5
6 pub use listrust-analyzer cargo tui-react 0.24.0 list/::*;
7 pub use terminalrust-analyzer cargo tui-react 0.24.0 terminal/::*;
8
9 use tuirust-analyzer cargo ratatui 0.30.0 crate/::{selfrust-analyzer cargo ratatui 0.30.0 crate/, bufferrust-analyzer cargo ratatui-core 0.1.0 buffer/::Bufferrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/Buffer#, layoutrust-analyzer cargo ratatui-core 0.1.0 layout/::Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, stylerust-analyzer cargo ratatui-core 0.1.0 style/::Colorrust-analyzer cargo ratatui-core 0.1.0 style/color/Color#, stylerust-analyzer cargo ratatui-core 0.1.0 style/::Stylerust-analyzer cargo ratatui-core 0.1.0 style/Style#};
10 use unicode_segmentationrust-analyzer cargo unicode-segmentation 1.12.0 crate/::UnicodeSegmentationrust-analyzer cargo unicode-segmentation 1.12.0 UnicodeSegmentation#;
11 use unicode_widthrust-analyzer cargo unicode-width 0.2.2 crate/::UnicodeWidthStrrust-analyzer cargo unicode-width 0.2.2 UnicodeWidthStr#;
12
13 pub fn fill_background_to_rightrust-analyzer cargo tui-react 0.24.0 fill_background_to_right().(mut s: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, entire_width: u16) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
14 match (s.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().(), entire_width as usize) {
15 (x, y) if x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().y => s,
16 (x, y) => {
17 s.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Extend<char>`]extend().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::repeat_nrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/sources/repeat_n/repeat_n().(' ', y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().x));
18 s
19 }
20 }
21 }
22
23 /// Helper method to quickly set the background of all cells inside the specified area.
24 pub fn fill_backgroundrust-analyzer cargo tui-react 0.24.0 fill_background().(area: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, buf: &mut Bufferrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/Buffer#, color: Colorrust-analyzer cargo ratatui-core 0.1.0 style/color/Color#) {
25 for y in area.toprust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]top().()..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#area.bottomrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]bottom().() {
26 for x in area.leftrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]left().()..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#area.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().() {
27 buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().(x, y)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..set_bgrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_bg().(color);
28 }
29 }
30 }
31
32 pub fn draw_text_with_ellipsis_nowraprust-analyzer cargo tui-react 0.24.0 draw_text_with_ellipsis_nowrap().(
33 bound: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#,
34 buf: &mut Bufferrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/Buffer#,
35 text: impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>,
36 style: impl Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stylerust-analyzer cargo ratatui-core 0.1.0 style/Style#>>,
37 ) -> u16 {
38 let s = style.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().();
39 let t = text.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().();
40 let mut graphemes = t.graphemesrust-analyzer cargo unicode-segmentation 1.12.0 impl#[str][UnicodeSegmentation]graphemes().(true);
41 let mut total_width = 0;
42 {
43 let mut ellipsis_candidate_x = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#;
44 let mut x_offset = 0;
45 for (g, mut x) in graphemes.by_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#by_ref().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(bound.leftrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]left().()..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#bound.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().()) {
46 let width = g.widthrust-analyzer cargo unicode-width 0.2.2 impl#[str][UnicodeWidthStr]width().();
47 total_width rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().width;
48
49 x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().x_offset;
50 let cell = &mut buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().(x, bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().;
51 if x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().bound.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().() {
52 ellipsis_candidate_x = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(x);
53 }
54 cell.set_symbolrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_symbol().(g);
55 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(s) = s {
56 cell.set_stylerust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_style().(s);
57 }
58
59 x_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`AddAssign<Self>`]add_assign().width.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]saturating_sub().(1) as u16;
60 if x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().x_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]ge().bound.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().() {
61 break;
62 }
63 let x = x as usize;
64 for x in x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().width {
65 let i = buf.index_ofrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/impl#[Buffer]index_of().(x as u16, bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.);
66 buf.contentrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/Buffer#content.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut()..resetrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]reset().();
67 }
68 }
69 if let (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(x)) = (graphemes.nextrust-analyzer cargo unicode-segmentation 1.12.0 grapheme/impl#[`Graphemes<'a>`][Iterator]next().(), ellipsis_candidate_x) {
70 buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().(x, bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..set_symbolrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_symbol().("…");
71 }
72 }
73 total_width as u16
74 }
75
76 pub fn draw_text_nowrap_fnrust-analyzer cargo tui-react 0.24.0 draw_text_nowrap_fn().(
77 bound: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#,
78 buf: &mut Bufferrust-analyzer cargo ratatui-core 0.1.0 buffer/buffer/Buffer#,
79 t: impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>,
80 mut s: impl FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&str, u16, u16) -> Stylerust-analyzer cargo ratatui-core 0.1.0 style/Style#,
81 ) {
82 if bound.widthrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#width. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().0 {
83 return;
84 }
85 for (g, x) in t.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().().graphemesrust-analyzer cargo unicode-segmentation 1.12.0 impl#[str][UnicodeSegmentation]graphemes().(true).ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(bound.leftrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]left().()..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#bound.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().()) {
86 let cell = &mut buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().(x, bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().;
87 cell.set_symbolrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_symbol().(g);
88 cell.set_stylerust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]set_style().(s(cell.symbolrust-analyzer cargo ratatui-core 0.1.0 buffer/cell/impl#[Cell]symbol().(), x, bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.));
89 }
90 }
91
92 pub mod utilrust-analyzer cargo tui-react 0.24.0 util/ {
93 use unicode_segmentationrust-analyzer cargo unicode-segmentation 1.12.0 crate/::UnicodeSegmentationrust-analyzer cargo unicode-segmentation 1.12.0 UnicodeSegmentation#;
94 use unicode_widthrust-analyzer cargo unicode-width 0.2.2 crate/::UnicodeWidthStrrust-analyzer cargo unicode-width 0.2.2 UnicodeWidthStr#;
95
96 pub fn sanitize_offsetrust-analyzer cargo tui-react 0.24.0 util/sanitize_offset().(offset: u16, num_items: usize, num_displayable_lines: u16) -> u16 {
97 offset.minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().((num_items.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]saturating_sub().(num_displayable_lines as usize)) as u16)
98 }
99
100 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
101 pub struct GraphemeCountWriterrust-analyzer cargo tui-react 0.24.0 util/GraphemeCountWriter#(pub usize);
102
103 impl stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write# for GraphemeCountWriterrust-analyzer cargo tui-react 0.24.0 util/GraphemeCountWriter# {
104 fn writerust-analyzer cargo tui-react 0.24.0 util/impl#[GraphemeCountWriter][Write]write().(&mut self, buf: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<usize, stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
105 self.0rust-analyzer cargo tui-react 0.24.0 util/GraphemeCountWriter#0. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(buf).graphemesrust-analyzer cargo unicode-segmentation 1.12.0 impl#[str][UnicodeSegmentation]graphemes().(true).countrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#count().();
106 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(buf.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().())
107 }
108
109 fn flushrust-analyzer cargo tui-react 0.24.0 util/impl#[GraphemeCountWriter][Write]flush().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
110 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
111 }
112 }
113
114 pub fn block_widthrust-analyzer cargo tui-react 0.24.0 util/block_width().(s: &str) -> u16 {
115 s.widthrust-analyzer cargo unicode-width 0.2.2 impl#[str][UnicodeWidthStr]width().() as u16
116 }
117
118 pub mod rectrust-analyzer cargo tui-react 0.24.0 util/rect/ {
119 use tuirust-analyzer cargo ratatui 0.30.0 crate/::layoutrust-analyzer cargo ratatui-core 0.1.0 layout/::Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#;
120
121 /// A safe version of Rect::intersection that doesn't suffer from underflows
122 pub fn intersectrust-analyzer cargo tui-react 0.24.0 util/rect/intersect().(lhs: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, rhs: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#) -> Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
123 let x1 = lhs.xrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#x..maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(rhs.xrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#x.);
124 let y1 = lhs.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y..maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(rhs.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.);
125 let x2 = lhs.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().().minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(rhs.rightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]right().());
126 let y2 = lhs.bottomrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]bottom().().minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(rhs.bottomrust-analyzer cargo ratatui-core 0.1.0 layout/rect/impl#[Rect]bottom().());
127 Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
128 xrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#x.: x1,
129 yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.: y1,
130 widthrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#width.: x2.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]saturating_sub().(x1),
131 heightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#height.: y2.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]saturating_sub().(y1),
132 }
133 }
134
135 pub fn offset_xrust-analyzer cargo tui-react 0.24.0 util/rect/offset_x().(r: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, offset: u16) -> Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
136 Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
137 xrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#x.: r.xrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().offset,
138 widthrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#width.: r.widthrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#width..saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]saturating_sub().(offset),
139 ..r
140 }
141 }
142
143 pub fn snap_to_rightrust-analyzer cargo tui-react 0.24.0 util/rect/snap_to_right().(bound: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, new_width: u16) -> Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
144 offset_xrust-analyzer cargo tui-react 0.24.0 util/rect/offset_x().(bound, bound.widthrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#width..saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]saturating_sub().(new_width))
145 }
146
147 pub fn line_boundrust-analyzer cargo tui-react 0.24.0 util/rect/line_bound().(bound: Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#, line: usize) -> Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
148 Rectrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect# {
149 yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y.: bound.yrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u16][`Add<Self>`]add().line as u16,
150 heightrust-analyzer cargo ratatui-core 0.1.0 layout/rect/Rect#height.: 1,
151 ..bound
152 }
153 }
154 }
155 }