pub struct FactoryVecDequeGuard<'a, C: FactoryComponent> { /* private fields */ }
Expand description

Provides methods to edit the underlying FactoryVecDeque.

The changes will be rendered on the widgets after the guard goes out of scope.

Implementations§

source§

impl<'a, C: FactoryComponent> FactoryVecDequeGuard<'a, C>

source

pub fn drop(self)

Drops the guard and renders all changes.

Use this to transfer full ownership back to the FactoryVecDeque.

source

pub fn get_mut(&mut self, index: usize) -> Option<&mut C>

Tries to get a mutable reference to the model of one element.

Returns None if index is invalid.

Examples found in repository?
relm4/examples/entry.rs (line 127)
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    fn update(&mut self, message: Self::Input, _sender: ComponentSender<Self>) {
        match message {
            AppMsg::AddCounters => {
                let text = self.entry.text();
                if let Ok(v) = text.parse::<i32>() {
                    let mut guard = self.counters.guard();
                    if v.is_positive() {
                        // add as many counters as user entered
                        for _ in 0..v {
                            guard.push_back(self.created_counters);
                            self.created_counters += 1;
                        }
                    } else if v.is_negative() {
                        // remove counters
                        for _ in v..0 {
                            guard.pop_front();
                        }
                    }

                    // clearing the entry value clears the entry widget
                    self.entry.set_text("");
                }
            }
            AppMsg::Clicked(index) => {
                if let Some(counter) = self.counters.guard().get_mut(index.current_index()) {
                    counter.value = counter.value.wrapping_sub(1);
                }
            }
        }
    }
source

pub fn back_mut(&mut self) -> Option<&mut C>

Provides a mutable reference to the model of the back element.

Returns None if the deque is empty.

source

pub fn front_mut(&mut self) -> Option<&mut C>

Provides a mutable reference to the model of the front element.

Returns None if the deque is empty.

source

pub fn pop_back(&mut self) -> Option<C>

Removes the last element from the FactoryVecDeque and returns it, or None if it is empty.

Examples found in repository?
relm4/examples/grid_factory.rs (line 217)
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();

        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
        }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 194)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn pop_front(&mut self) -> Option<C>

Removes the first element from the FactoryVecDeque and returns it, or None if it is empty.

Examples found in repository?
relm4/examples/entry.rs (line 118)
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    fn update(&mut self, message: Self::Input, _sender: ComponentSender<Self>) {
        match message {
            AppMsg::AddCounters => {
                let text = self.entry.text();
                if let Ok(v) = text.parse::<i32>() {
                    let mut guard = self.counters.guard();
                    if v.is_positive() {
                        // add as many counters as user entered
                        for _ in 0..v {
                            guard.push_back(self.created_counters);
                            self.created_counters += 1;
                        }
                    } else if v.is_negative() {
                        // remove counters
                        for _ in v..0 {
                            guard.pop_front();
                        }
                    }

                    // clearing the entry value clears the entry widget
                    self.entry.set_text("");
                }
            }
            AppMsg::Clicked(index) => {
                if let Some(counter) = self.counters.guard().get_mut(index.current_index()) {
                    counter.value = counter.value.wrapping_sub(1);
                }
            }
        }
    }
source

pub fn remove(&mut self, index: usize) -> Option<C>

Removes and returns the element at index from the FactoryVecDeque. Returns None if index is out of bounds.

Element at index 0 is the front of the queue.

Examples found in repository?
relm4/examples/to_do.rs (line 131)
128
129
130
131
132
133
134
135
136
137
    fn update(&mut self, msg: AppMsg, _sender: ComponentSender<Self>) {
        match msg {
            AppMsg::DeleteEntry(index) => {
                self.tasks.guard().remove(index.current_index());
            }
            AppMsg::AddEntry(name) => {
                self.tasks.guard().push_back(name);
            }
        }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 215)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn push_back(&mut self, init: C::Init) -> DynamicIndex

Appends an element at the end of the FactoryVecDeque.

Examples found in repository?
relm4/examples/to_do.rs (line 134)
128
129
130
131
132
133
134
135
136
137
    fn update(&mut self, msg: AppMsg, _sender: ComponentSender<Self>) {
        match msg {
            AppMsg::DeleteEntry(index) => {
                self.tasks.guard().remove(index.current_index());
            }
            AppMsg::AddEntry(name) => {
                self.tasks.guard().push_back(name);
            }
        }
    }
More examples
Hide additional examples
relm4/examples/grid_factory.rs (line 213)
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();

        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
        }
    }
relm4/examples/entry.rs (line 112)
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    fn update(&mut self, message: Self::Input, _sender: ComponentSender<Self>) {
        match message {
            AppMsg::AddCounters => {
                let text = self.entry.text();
                if let Ok(v) = text.parse::<i32>() {
                    let mut guard = self.counters.guard();
                    if v.is_positive() {
                        // add as many counters as user entered
                        for _ in 0..v {
                            guard.push_back(self.created_counters);
                            self.created_counters += 1;
                        }
                    } else if v.is_negative() {
                        // remove counters
                        for _ in v..0 {
                            guard.pop_front();
                        }
                    }

                    // clearing the entry value clears the entry widget
                    self.entry.set_text("");
                }
            }
            AppMsg::Clicked(index) => {
                if let Some(counter) = self.counters.guard().get_mut(index.current_index()) {
                    counter.value = counter.value.wrapping_sub(1);
                }
            }
        }
    }
relm4/examples/factory.rs (line 190)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn push_front(&mut self, init: C::Init) -> DynamicIndex

Prepends an element to the FactoryVecDeque.

source

pub fn insert(&mut self, index: usize, init: C::Init) -> DynamicIndex

Inserts an element at index within the FactoryVecDeque, shifting all elements with indices greater than or equal to index towards the back.

Element at index 0 is the front of the queue.

Panics

Panics if index is greater than FactoryVecDeque’s length.

source

pub fn swap(&mut self, first: usize, second: usize)

Swaps elements at indices first and second.

first and second may be equal.

Element at index 0 is the front of the queue.

Panics

Panics if either index is out of bounds.

source

pub fn move_to(&mut self, current_position: usize, target: usize)

Moves an element at index current_position to target, shifting all elements between these positions.

current_position and target may be equal.

Element at index 0 is the front of the queue.

Panics

Panics if either index is out of bounds.

Examples found in repository?
relm4/examples/grid_factory.rs (line 227)
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();

        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
        }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 204)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn move_front(&mut self, current_position: usize)

Moves an element at index current_position to the front, shifting all elements between these positions.

Panics

Panics if index is out of bounds.

Examples found in repository?
relm4/examples/grid_factory.rs (line 220)
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();

        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
        }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 197)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn move_back(&mut self, current_position: usize)

Moves an element at index current_position to the back, shifting all elements between these positions.

Panics

Panics if index is out of bounds.

source

pub fn clear(&mut self)

Remove all components from the FactoryVecDeque.

source

pub fn iter_mut( &mut self ) -> impl Iterator<Item = &mut C> + DoubleEndedIterator + ExactSizeIterator + FusedIterator

Returns an iterator over the components that returns mutable references.

Methods from Deref<Target = FactoryVecDeque<C>>§

source

pub fn len(&self) -> usize

Returns the number of elements in the FactoryVecDeque.

Examples found in repository?
relm4/examples/grid_factory.rs (line 226)
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();

        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
        }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 203)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {
        let mut counters_guard = self.counters.guard();
        match msg {
            AppMsg::AddCounter => {
                counters_guard.push_back(self.created_widgets);
                self.created_widgets = self.created_widgets.wrapping_add(1);
            }
            AppMsg::RemoveCounter => {
                counters_guard.pop_back();
            }
            AppMsg::SendFront(index) => {
                counters_guard.move_front(index.current_index());
            }
            AppMsg::MoveDown(index) => {
                let index = index.current_index();
                let new_index = index + 1;
                // Already at the end?
                if new_index < counters_guard.len() {
                    counters_guard.move_to(index, new_index);
                }
            }
            AppMsg::MoveUp(index) => {
                let index = index.current_index();
                // Already at the start?
                if index != 0 {
                    counters_guard.move_to(index, index - 1);
                }
            }
            AppMsg::Remove(index) => {
                counters_guard.remove(index.current_index());
            }
        }
    }
source

pub fn is_empty(&self) -> bool

Returns true if the FactoryVecDeque is empty.

source

pub fn send(&self, index: usize, msg: C::Input)

Send a message to one of the elements.

source

pub fn broadcast(&self, msg: C::Input)where C::Input: Clone,

Send clone of a message to all of the elements.

source

pub fn get(&self, index: usize) -> Option<&C>

Tries to get an immutable reference to the model of one element.

Returns None if index is invalid.

source

pub fn back(&self) -> Option<&C>

Provides a reference to the model of the back element.

Returns None if the deque is empty.

source

pub fn front(&self) -> Option<&C>

Provides a reference to the model of the front element.

Returns None if the deque is empty.

source

pub fn widget(&self) -> &C::ParentWidget

Returns the widget all components are attached to.

Examples found in repository?
relm4/examples/to_do.rs (line 148)
139
140
141
142
143
144
145
146
147
148
149
150
151
152
    fn init(
        _: Self::Init,
        root: &Self::Root,
        sender: ComponentSender<Self>,
    ) -> ComponentParts<Self> {
        let model = App {
            tasks: FactoryVecDeque::new(gtk::ListBox::default(), sender.input_sender()),
        };

        let task_list_box = model.tasks.widget();
        let widgets = view_output!();

        ComponentParts { model, widgets }
    }
More examples
Hide additional examples
relm4/examples/factory.rs (line 180)
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
    fn init(
        counter: Self::Init,
        root: &Self::Root,
        sender: ComponentSender<Self>,
    ) -> ComponentParts<Self> {
        let counters = FactoryVecDeque::new(gtk::Box::default(), sender.input_sender());
        let model = App {
            created_widgets: counter,
            counters,
        };

        let counter_box = model.counters.widget();
        let widgets = view_output!();

        ComponentParts { model, widgets }
    }
relm4/examples/grid_factory.rs (line 202)
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
    fn init(
        counter: Self::Init,
        root: &Self::Root,
        sender: ComponentSender<Self>,
    ) -> ComponentParts<Self> {
        let counters = FactoryVecDeque::new(gtk::Grid::default(), sender.input_sender());
        let model = App {
            created_widgets: counter,
            counters,
        };

        let counter_grid = model.counters.widget();
        let widgets = view_output!();

        ComponentParts { model, widgets }
    }
source

pub fn iter( &self ) -> impl Iterator<Item = &C> + DoubleEndedIterator + ExactSizeIterator + FusedIterator

Returns an iterator over the components.

Trait Implementations§

source§

impl<'a, C: Debug + FactoryComponent> Debug for FactoryVecDequeGuard<'a, C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, C: FactoryComponent> Deref for FactoryVecDequeGuard<'a, C>

§

type Target = FactoryVecDeque<C>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, C: FactoryComponent> Drop for FactoryVecDequeGuard<'a, C>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, C: FactoryComponent> Index<usize> for FactoryVecDequeGuard<'a, C>

§

type Output = C

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, C: FactoryComponent> IndexMut<usize> for FactoryVecDequeGuard<'a, C>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a, C> !RefUnwindSafe for FactoryVecDequeGuard<'a, C>

§

impl<'a, C> !Send for FactoryVecDequeGuard<'a, C>

§

impl<'a, C> !Sync for FactoryVecDequeGuard<'a, C>

§

impl<'a, C> Unpin for FactoryVecDequeGuard<'a, C>

§

impl<'a, C> !UnwindSafe for FactoryVecDequeGuard<'a, C>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<C> AsyncPosition<()> for C

source§

fn position(_index: usize)

Returns the position. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<C> Position<()> for C

source§

fn position(&self, _index: usize)

Returns the position. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more