Skip to main content

Arc

Struct Arc 

1.0.0 · Source
pub struct Arc<T, A = Global>
where A: Allocator, T: ?Sized,
{ /* private fields */ }
Expand description

A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.

The type Arc<T> provides shared ownership of a value of type T, allocated in the heap. Invoking clone on Arc produces a new Arc instance, which points to the same allocation on the heap as the source Arc, while increasing a reference count. When the last Arc pointer to a given allocation is destroyed, the value stored in that allocation (often referred to as “inner value”) is also dropped.

Shared references in Rust disallow mutation by default, and Arc is no exception: you cannot generally obtain a mutable reference to something inside an Arc. If you do need to mutate through an Arc, you have several options:

  1. Use interior mutability with synchronization primitives like Mutex, RwLock, or one of the Atomic types.

  2. Use clone-on-write semantics with Arc::make_mut which provides efficient mutation without requiring interior mutability. This approach clones the data only when needed (when there are multiple references) and can be more efficient when mutations are infrequent.

  3. Use Arc::get_mut when you know your Arc is not shared (has a reference count of 1), which provides direct mutable access to the inner value without any cloning.

use std::sync::Arc;

let mut data = Arc::new(vec![1, 2, 3]);

// This will clone the vector only if there are other references to it
Arc::make_mut(&mut data).push(4);

assert_eq!(*data, vec![1, 2, 3, 4]);

Note: This type is only available on platforms that support atomic loads and stores of pointers, which includes all platforms that support the std crate but not all those which only support alloc. This may be detected at compile time using #[cfg(target_has_atomic = "ptr")].

§Thread Safety

Unlike Rc<T>, Arc<T> uses atomic operations for its reference counting. This means that it is thread-safe. The disadvantage is that atomic operations are more expensive than ordinary memory accesses. If you are not sharing reference-counted allocations between threads, consider using Rc<T> for lower overhead. Rc<T> is a safe default, because the compiler will catch any attempt to send an Rc<T> between threads. However, a library might choose Arc<T> in order to give library consumers more flexibility.

Arc<T> will implement Send and Sync as long as the T implements Send and Sync. Why can’t you put a non-thread-safe type T in an Arc<T> to make it thread-safe? This may be a bit counter-intuitive at first: after all, isn’t the point of Arc<T> thread safety? The key is this: Arc<T> makes it thread safe to have multiple ownership of the same data, but it doesn’t add thread safety to its data. Consider Arc<RefCell<T>>. RefCell<T> isn’t Sync, and if Arc<T> was always Send, Arc<RefCell<T>> would be as well. But then we’d have a problem: RefCell<T> is not thread safe; it keeps track of the borrowing count using non-atomic operations.

In the end, this means that you may need to pair Arc<T> with some sort of std::sync type, usually Mutex<T>.

§Breaking cycles with Weak

The downgrade method can be used to create a non-owning Weak pointer. A Weak pointer can be upgraded to an Arc, but this will return None if the value stored in the allocation has already been dropped. In other words, Weak pointers do not keep the value inside the allocation alive; however, they do keep the allocation (the backing store for the value) alive.

A cycle between Arc pointers will never be deallocated. For this reason, Weak is used to break cycles. For example, a tree could have strong Arc pointers from parent nodes to children, and Weak pointers from children back to their parents.

§Cloning references

Creating a new reference from an existing reference-counted pointer is done using the Clone trait implemented for Arc<T> and Weak<T>.

use std::sync::Arc;
let foo = Arc::new(vec![1.0, 2.0, 3.0]);
// The two syntaxes below are equivalent.
let a = foo.clone();
let b = Arc::clone(&foo);
// a, b, and foo are all Arcs that point to the same memory location

§Deref behavior

Arc<T> automatically dereferences to T (via the Deref trait), so you can call T’s methods on a value of type Arc<T>. To avoid name clashes with T’s methods, the methods of Arc<T> itself are associated functions, called using fully qualified syntax:

use std::sync::Arc;

let my_arc = Arc::new(());
let my_weak = Arc::downgrade(&my_arc);

Arc<T>’s implementations of traits like Clone may also be called using fully qualified syntax. Some people prefer to use fully qualified syntax, while others prefer using method-call syntax.

use std::sync::Arc;

let arc = Arc::new(());
// Method-call syntax
let arc2 = arc.clone();
// Fully qualified syntax
let arc3 = Arc::clone(&arc);

Weak<T> does not auto-dereference to T, because the inner value may have already been dropped.

§Examples

Sharing some immutable data between threads:

ⓘ
use std::sync::Arc;
use std::thread;

let five = Arc::new(5);

for _ in 0..10 {
    let five = Arc::clone(&five);

    thread::spawn(move || {
        println!("{five:?}");
    });
}

Sharing a mutable AtomicUsize:

ⓘ
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;

let val = Arc::new(AtomicUsize::new(5));

for _ in 0..10 {
    let val = Arc::clone(&val);

    thread::spawn(move || {
        let v = val.fetch_add(1, Ordering::Relaxed);
        println!("{v:?}");
    });
}

See the rc documentation for more examples of reference counting in general.

Implementations§

Source§

impl<T> Arc<T>

1.0.0 · Source

pub fn new(data: T) -> Arc<T> ⓘ

Available on non-no_global_oom_handling only.

Constructs a new Arc<T>.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
Examples found in repository?
examples/3d/occlusion_culling.rs (line 134)
133    fn new() -> Self {
134        Self(Arc::new(Mutex::new(None)))
135    }
More examples
Hide additional examples
examples/asset/multi_asset_sync.rs (lines 95-98)
94    pub fn new() -> (AssetBarrier, AssetBarrierGuard) {
95        let inner = Arc::new(AssetBarrierInner {
96            count: AtomicU32::new(1),
97            notify: Event::new(),
98        });
99        (AssetBarrier(inner.clone()), AssetBarrierGuard(inner))
100    }
101
102    /// Returns true if all [`AssetBarrierGuard`] is dropped.
103    pub fn is_ready(&self) -> bool {
104        self.count.load(Ordering::Acquire) == 0
105    }
106
107    /// Wait for all [`AssetBarrierGuard`]s to be dropped asynchronously.
108    pub fn wait_async(&self) -> impl Future<Output = ()> + 'static {
109        let shared = self.0.clone();
110        async move {
111            loop {
112                // Acquire an event listener.
113                let listener = shared.notify.listen();
114                // If all barrier guards are dropped, return
115                if shared.count.load(Ordering::Acquire) == 0 {
116                    return;
117                }
118                // Wait for the last barrier guard to notify us
119                listener.await;
120            }
121        }
122    }
123}
124
125// Increment count on clone.
126impl Clone for AssetBarrierGuard {
127    fn clone(&self) -> Self {
128        self.count.fetch_add(1, Ordering::AcqRel);
129        AssetBarrierGuard(self.0.clone())
130    }
131}
132
133// Decrement count on drop.
134impl Drop for AssetBarrierGuard {
135    fn drop(&mut self) {
136        let prev = self.count.fetch_sub(1, Ordering::AcqRel);
137        if prev == 1 {
138            // Notify all listeners if count reaches 0.
139            self.notify.notify(usize::MAX);
140        }
141    }
142}
143
144fn setup_assets(mut commands: Commands, asset_server: Res<AssetServer>) {
145    let (barrier, guard) = AssetBarrier::new();
146    commands.insert_resource(OneHundredThings(std::array::from_fn(|i| {
147        let builder = asset_server.load_builder().with_guard(guard.clone());
148        match i % 5 {
149            0 => builder.load("models/GolfBall/GolfBall.glb"),
150            1 => builder.load("models/AlienCake/alien.glb"),
151            2 => builder.load("models/AlienCake/cakeBirthday.glb"),
152            3 => builder.load("models/FlightHelmet/FlightHelmet.gltf"),
153            4 => builder.load("models/torus/torus.gltf"),
154            _ => unreachable!(),
155        }
156    })));
157    let future = barrier.wait_async();
158    commands.insert_resource(barrier);
159
160    let loading_state = Arc::new(AtomicBool::new(false));
161    commands.insert_resource(AsyncLoadingState(loading_state.clone()));
162
163    // await the `AssetBarrierFuture`.
164    AsyncComputeTaskPool::get()
165        .spawn(async move {
166            future.await;
167            // Notify via `AsyncLoadingState`
168            loading_state.store(true, Ordering::Release);
169        })
170        .detach();
171}
examples/app/headless_renderer.rs (line 306)
290    pub fn new(
291        src_image: Handle<Image>,
292        size: Extent3d,
293        render_device: &RenderDevice,
294    ) -> ImageCopier {
295        let padded_bytes_per_row = RenderDevice::align_copy_bytes_per_row(size.width as usize * 4);
296        let cpu_buffer = render_device.create_buffer(&BufferDescriptor {
297            label: None,
298            size: padded_bytes_per_row as u64 * size.height as u64,
299            usage: BufferUsages::MAP_READ | BufferUsages::COPY_DST,
300            mapped_at_creation: false,
301        });
302
303        ImageCopier {
304            buffer: cpu_buffer,
305            src_image,
306            enabled: Arc::new(AtomicBool::new(true)),
307        }
308    }
examples/shader_advanced/manual_material.rs (line 211)
147    fn prepare_asset(
148        source_asset: Self::SourceAsset,
149        asset_id: AssetId<Self::SourceAsset>,
150        (
151            opaque_draw_functions,
152            material_layout,
153            asset_server,
154            bind_group_allocators,
155            render_material_bindings,
156            gpu_images,
157            image_material_sampler,
158        ): &mut SystemParamItem<Self::Param>,
159    ) -> std::result::Result<Self::ErasedAsset, PrepareAssetError<Self::SourceAsset>> {
160        let material_layout = material_layout.0.clone();
161        let draw_function_id = opaque_draw_functions.read().id::<DrawMaterial>();
162        let bind_group_allocator = bind_group_allocators
163            .get_mut(&TypeId::of::<ImageMaterial>())
164            .unwrap();
165        let Some(image) = gpu_images.get(&source_asset.image) else {
166            return Err(PrepareAssetError::RetryNextUpdate(source_asset));
167        };
168        let mut unprepared = BindGroupBuilder {
169            binding_resources: UnpreparedBindingResources(vec![
170                (
171                    0,
172                    UnpreparedBindingResource::TextureView(
173                        TextureViewDimension::D2,
174                        image.texture_view.clone(),
175                    ),
176                ),
177                (
178                    1,
179                    UnpreparedBindingResource::Sampler(
180                        SamplerBindingType::NonFiltering,
181                        image_material_sampler.0.clone(),
182                    ),
183                ),
184            ]),
185            data_buffer: vec![],
186        };
187        let binding = match render_material_bindings.entry(asset_id.into()) {
188            Entry::Occupied(mut occupied_entry) => {
189                bind_group_allocator.free(*occupied_entry.get());
190                let new_binding =
191                    bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout);
192                *occupied_entry.get_mut() = new_binding;
193                new_binding
194            }
195            Entry::Vacant(vacant_entry) => *vacant_entry.insert(
196                bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout),
197            ),
198        };
199
200        let mut properties = MaterialProperties {
201            material_layout: Some(material_layout),
202            mesh_pipeline_key_bits: ErasedMeshPipelineKey::new(MeshPipelineKey::empty()),
203            base_specialize: Some(base_specialize),
204            ..Default::default()
205        };
206        properties.add_draw_function(MainPassOpaqueDrawFunction, draw_function_id);
207        properties.add_shader(MaterialFragmentShader, asset_server.load(SHADER_ASSET_PATH));
208
209        Ok(PreparedMaterial {
210            binding,
211            properties: Arc::new(properties),
212        })
213    }
examples/ui/widgets/feathers_gallery.rs (lines 170-212)
168fn demo_column_1() -> impl Scene {
169    // Lazily-constructed menu popup
170    let popup: Arc<dyn Fn() -> Box<dyn Scene> + Sync + Send> = Arc::new(|| {
171        Box::new(bsn! {
172            @FeathersMenuPopup
173            // Override popover placement to right-align the popup
174            Popover {
175                positions: vec![
176                    PopoverPlacement {
177                        side: PopoverSide::Bottom,
178                        align: PopoverAlign::End,
179                        gap: 2.0,
180                    },
181                    PopoverPlacement {
182                        side: PopoverSide::Top,
183                        align: PopoverAlign::End,
184                        gap: 2.0,
185                    },
186                ],
187                window_margin: 10.0,
188            }
189            Children [
190                @FeathersMenuItem {
191                    @caption: bsn! { @caption("MenuItem 4") }
192                }
193                on(|_: On<Activate>| {
194                    info!("Menu item 4 clicked!");
195                })
196                --
197                @FeathersMenuItem {
198                    @caption: bsn! { @caption("MenuItem 5") }
199                }
200                on(|_: On<Activate>| {
201                    info!("Menu item 5 clicked!");
202                })
203                --
204                @FeathersMenuItem {
205                    @caption: bsn! { @caption("MenuItem 6") }
206                }
207                on(|_: On<Activate>| {
208                    info!("Menu item 6 clicked!");
209                })
210            ]
211        })
212    });
213
214    bsn! {
215        Node {
216            display: Display::Flex,
217            flex_direction: FlexDirection::Column,
218            align_items: AlignItems::Stretch,
219            justify_content: JustifyContent::Start,
220            padding: px(8),
221            row_gap: px(8),
222            width: percent(30),
223            min_width: px(200),
224        }
225        Children [
226            Node {
227                display: Display::Flex,
228                flex_direction: FlexDirection::Row,
229                align_items: AlignItems::Center,
230                justify_content: JustifyContent::Start,
231                column_gap: px(8),
232            }
233            Children [
234                @FeathersButton {
235                    @caption: bsn! { @caption("Normal") }
236                }
237                Node {
238                    flex_grow: 1.0,
239                }
240                AccessibleLabel("Normal")
241                on(|_activate: On<Activate>| {
242                    info!("Normal button clicked!");
243                })
244                AutoFocus
245                --
246                @FeathersButton {
247                    @caption: bsn! { @caption("Disabled") },
248                }
249                Node {
250                    flex_grow: 1.0,
251                }
252                AccessibleLabel("Disabled")
253                InteractionDisabled
254                DemoDisabledButton
255                on(|_activate: On<Activate>| {
256                    info!("Disabled button clicked!");
257                })
258                --
259                @FeathersButton {
260                    @caption: bsn! { @caption("Primary") },
261                    @variant: ButtonVariant::Primary,
262                }
263                AccessibleLabel("Primary")
264                Node {
265                    flex_grow: 1.0,
266                }
267                on(|_activate: On<Activate>| {
268                    info!("Primary button clicked!");
269                })
270                --
271                @FeathersMenu
272                Children [
273                    @FeathersMenuButton {
274                        @caption: bsn! { @caption("Menu") }
275                    }
276                    AccessibleLabel("Menu Example")
277                    Node {
278                        flex_grow: 1.0,
279                    }
280                    --
281                    @FeathersMenuPopup
282                    Children [
283                        @FeathersMenuItem {
284                            @caption: bsn! { @caption("MenuItem 1") }
285                        }
286                        on(|_: On<Activate>| {
287                            info!("Menu item 1 clicked!");
288                        })
289                        --
290                        @FeathersMenuItem {
291                            @caption: bsn! { @caption("MenuItem 2") }
292                        }
293                        on(|_: On<Activate>| {
294                            info!("Menu item 2 clicked!");
295                        })
296                        --
297                        @FeathersMenuDivider
298                        --
299                        @FeathersMenuItem {
300                            @caption: bsn! { @caption("MenuItem 3") }
301                        }
302                        on(|_: On<Activate>| {
303                            info!("Menu item 3 clicked!");
304                        })
305                    ]
306                ]
307                --
308                @FeathersLazyMenu { popup }
309                Children [
310                    @FeathersMenuToolButton {
311                        @caption: bsn! { @caption("\u{0398}") }
312                    }
313                    AccessibleLabel("Menu Example")
314                    Node {
315                        flex_grow: 1.0,
316                    }
317                ]
318            ]
319            --
320            @FeathersSelect {
321                @options: list_rows_from_strings([
322                    "One",
323                    "Two",
324                    "Three",
325                ], Some(0)),
326            }
327            Node {
328                flex_grow: 1.0,
329            }
330            on(|change: On<ValueChange<Entity>>, q_options: Query<&OptionIndex>| {
331                let Ok(option) = q_options.get(change.value) else {
332                    info!("Select changed, not sure");
333                    return;
334                };
335                info!("Select changed to index {}", option.0);
336            })
337            --
338            @FeathersSelect {
339                @options: {
340                    Box::new(
341                        Months::ALL
342                            .into_iter()
343                            .map(|m| -> Box<dyn SceneList> {
344                                let label = m.to_str();
345                                if m == Months::default() {
346                                    bsn! { @FeathersListRow Selected m Children [ @caption(label) ] }.into()
347                                } else {
348                                    bsn! { @FeathersListRow m Children [ @caption(label) ] }.into()
349                                }
350                            })
351                            .collect::<Vec<_>>(),
352                    ) as Box<dyn SceneList>
353                },
354                @max_visible: 6,
355            }
356            Node {
357                flex_grow: 1.0,
358            }
359            on(|change: On<ValueChange<Entity>>, q_months: Query<&Months>| {
360                let Ok(month) = q_months.get(change.value) else {
361                    return;
362                };
363                info!("Select changed to {:?}", month);
364            })
365            --
366            Node {
367                display: Display::Flex,
368                flex_direction: FlexDirection::Row,
369                align_items: AlignItems::Center,
370                justify_content: JustifyContent::Start,
371                column_gap: px(1),
372            }
373            Children [
374                @FeathersButton {
375                    @caption: bsn! { @caption("Left") },
376                    @corners: RoundedCorners::Left,
377                }
378                Node {
379                    flex_grow: 1.0,
380                }
381                AccessibleLabel("Left")
382                on(|_activate: On<Activate>| {
383                    info!("Left button clicked!");
384                })
385                --
386                @FeathersButton {
387                    @caption: bsn! { @caption("Center") },
388                    @corners: RoundedCorners::None,
389                }
390                Node {
391                    flex_grow: 1.0,
392                }
393                AccessibleLabel("Center")
394                on(|_activate: On<Activate>| {
395                    info!("Center button clicked!");
396                })
397                --
398                @FeathersButton {
399                    @caption: bsn! { @caption("Right") },
400                    @variant: ButtonVariant::Primary,
401                    @corners: RoundedCorners::Right,
402                }
403                Node {
404                    flex_grow: 1.0,
405                }
406                AccessibleLabel("Right")
407                on(|_activate: On<Activate>| {
408                    info!("Right button clicked!");
409                })
410            ]
411            --
412            Node {
413                display: Display::Flex,
414                flex_direction: FlexDirection::Row,
415                align_items: AlignItems::Center,
416                justify_content: JustifyContent::Start,
417                column_gap: px(8),
418            }
419            Children [
420                @FeathersButton {
421                    @caption: bsn! { @caption("Toggle override") },
422                }
423                Node {
424                    flex_grow: 1.0,
425                }
426                on(|_activate: On<Activate>, mut ovr: ResMut<OverrideCursor>| {
427                    ovr.0 = if ovr.0.is_some() {
428                        None
429                    } else {
430                        Some(EntityCursor::System(SystemCursorIcon::Wait))
431                    };
432                    info!("Override cursor button clicked!");
433                })
434                --
435                @FeathersButton {
436                    @caption: bsn! { @caption("Quit\u{2026}") },
437                }
438                Node {
439                    flex_grow: 1.0,
440                }
441                on(spawn_quit_dialog)
442            ]
443            --
444            Node {
445                display: Display::Flex,
446                flex_direction: FlexDirection::Row,
447                align_items: AlignItems::Center,
448                justify_content: JustifyContent::Start,
449                column_gap: px(8),
450            }
451            Children [
452                @label("Dialog:")
453                --
454                @FeathersToggleSwitch
455                DemoDialogToggle
456                on(toggle_demo_dialog)
457            ]
458            --
459            @FeathersCheckbox {
460                @caption: bsn! { @caption("Checkbox") }
461            }
462            Checked
463            AccessibleLabel("Checkbox Example")
464            on(|change: On<ValueChange<bool>>, query: Query<Entity, With<DemoDisabledButton>>, mut commands: Commands| {
465                info!("Checkbox clicked!");
466                let mut button = commands.entity(query.single().unwrap());
467                if change.value {
468                    button.insert(InteractionDisabled);
469                } else {
470                    button.remove::<InteractionDisabled>();
471                }
472                let mut checkbox = commands.entity(change.source);
473                if change.value {
474                    checkbox.insert(Checked);
475                } else {
476                    checkbox.remove::<Checked>();
477                }
478            })
479            --
480            @FeathersCheckbox {
481                @caption: bsn! { @caption("Fast Click Checkbox") }
482            }
483            ActivateOnPress
484            AccessibleLabel("Fast Click Checkbox Example")
485            on(|change: On<ValueChange<bool>>, mut commands: Commands| {
486                info!("Checkbox clicked!");
487                let mut checkbox = commands.entity(change.source);
488                if change.value {
489                    checkbox.insert(Checked);
490                } else {
491                    checkbox.remove::<Checked>();
492                }
493            })
494            --
495            @FeathersCheckbox {
496                @caption: bsn! { @caption("Disabled") },
497            }
498            InteractionDisabled
499            AccessibleLabel("Disabled Checkbox Example")
500            on(|_change: On<ValueChange<bool>>| {
501                warn!("Disabled checkbox clicked!");
502            })
503            --
504            @FeathersCheckbox {
505                @caption: bsn! { @caption("Checked+Disabled") }
506            }
507            InteractionDisabled
508            Checked
509            AccessibleLabel("Disabled and Checked Checkbox Example")
510            on(|_change: On<ValueChange<bool>>| {
511                warn!("Disabled checkbox clicked!");
512            })
513            --
514            Node {
515                display: Display::Flex,
516                flex_direction: FlexDirection::Row,
517                align_items: AlignItems::Center,
518                justify_content: JustifyContent::Start,
519                column_gap: px(8),
520            }
521            Children [
522                Node {
523                    display: Display::Flex,
524                    flex_direction: FlexDirection::Column,
525                    row_gap: px(4),
526                }
527                RadioGroup
528                on(radio_self_update)
529                Children [
530                    @FeathersRadio {
531                        @caption: bsn! { @caption("One") }
532                    }
533                    Checked
534                    --
535                    @FeathersRadio {
536                        @caption: bsn! { @caption("Two") }
537                    }
538                    --
539                    @FeathersRadio {
540                        @caption: bsn! { @caption("Fast Click") }
541                    }
542                    ActivateOnPress
543                    --
544                    @FeathersRadio {
545                        @caption: bsn! { @caption("Disabled") }
546                    }
547                    InteractionDisabled
548                ]
549            ]
550            --
551            Node {
552                display: Display::Flex,
553                flex_direction: FlexDirection::Row,
554                align_items: AlignItems::Center,
555                justify_content: JustifyContent::Start,
556                column_gap: px(8),
557            }
558            Children [
559                @FeathersToggleSwitch on(checkbox_self_update)
560                --
561                @FeathersToggleSwitch ActivateOnPress on(checkbox_self_update)
562                --
563                @FeathersToggleSwitch InteractionDisabled on(checkbox_self_update)
564                --
565                @FeathersToggleSwitch InteractionDisabled Checked on(checkbox_self_update)
566                --
567                @FeathersDisclosureToggle on(checkbox_self_update)
568            ]
569            --
570            @FeathersSlider {
571                @max: 100.0,
572            }
573            SliderValue(20.0)
574            SliderStep(10.)
575            SliderPrecision(2)
576            on(slider_self_update)
577            --
578            Node {
579                display: Display::Flex,
580                flex_direction: FlexDirection::Row,
581                align_items: AlignItems::Center,
582                justify_content: JustifyContent::SpaceBetween,
583                column_gap: px(4),
584            }
585            Children [
586                @label("Srgba")
587                --
588                @flex_spacer()
589                --
590                @FeathersTextInputContainer
591                Node {
592                    flex_grow: 0.
593                    padding: { px(4).left() },
594                }
595                Children [
596                    @FeathersTextInput {
597                        @visible_width: 10f32,
598                        @max_characters: 9usize,
599                    }
600                    InheritableFont {
601                        font: fonts::MONO
602                    }
603                    HexColorInput
604                    on(handle_hex_color_change)
605                ]
606                --
607                @FeathersColorSwatch {
608                    @opaque_color_percentage: 30.0,
609                }
610                SwatchType::Rgb
611            ]
612            --
613            @FeathersColorPlane::RedBlue
614            on(|change: On<ValueChange<Vec2>>, mut color: ResMut<DemoWidgetStates>| {
615                color.rgb_color.red = change.value.x;
616                color.rgb_color.blue = change.value.y;
617            })
618            --
619            @FeathersColorSlider {
620                @value: 0.5,
621                @channel: ColorChannel::Red
622            }
623            AccessibleLabel("Red Channel")
624            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
625                color.rgb_color.red = change.value;
626            })
627            --
628            @FeathersColorSlider {
629                @value: 0.5,
630                @channel: ColorChannel::Green
631            }
632            AccessibleLabel("Green Channel")
633            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
634                color.rgb_color.green = change.value;
635            })
636            --
637            @FeathersColorSlider {
638                @value: 0.5,
639                @channel: ColorChannel::Blue
640            }
641            AccessibleLabel("Blue Channel")
642            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
643                color.rgb_color.blue = change.value;
644            })
645            --
646            @FeathersColorSlider {
647                @value: 0.5,
648                @channel: ColorChannel::Alpha
649            }
650            AccessibleLabel("Alpha Channel")
651            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
652                color.rgb_color.alpha = change.value;
653            })
654            --
655            Node {
656                display: Display::Flex,
657                align_items: AlignItems::Center,
658                flex_direction: FlexDirection::Row,
659                justify_content: JustifyContent::SpaceBetween,
660            }
661            Children [
662                @label("Hsl")
663                --
664                @FeathersColorSwatch SwatchType::Hsl
665            ]
666            --
667            @FeathersColorSlider {
668                @value: 0.5,
669                @channel: ColorChannel::HslHue
670            }
671            AccessibleLabel("Hue Channel")
672            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
673                color.hsl_color.hue = change.value;
674            })
675            --
676            @FeathersColorSlider {
677                @value: 0.5,
678                @channel: ColorChannel::HslSaturation
679            }
680            AccessibleLabel("Saturation Channel")
681            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
682                color.hsl_color.saturation = change.value;
683            })
684            --
685            @FeathersColorSlider {
686                @value: 0.5,
687                @channel: ColorChannel::HslLightness
688            }
689            AccessibleLabel("Lightness Channel")
690            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
691                color.hsl_color.lightness = change.value;
692            })
693            --
694            Node {
695                display: Display::Flex,
696                align_items: AlignItems::Center,
697                flex_direction: FlexDirection::Row,
698                justify_content: JustifyContent::SpaceBetween,
699            }
700            Children [
701                @label("Okhsl")
702                --
703                @FeathersColorSwatch SwatchType::Okhsl
704            ]
705            --
706            @FeathersColorPlane::OkhslHueLightness
707            on(|change: On<ValueChange<Vec2>>, mut color: ResMut<DemoWidgetStates>| {
708                color.okhsl_color.hue = change.value.x * 360.0;
709                color.okhsl_color.lightness = 1.0 - change.value.y;
710            })
711            --
712            @FeathersColorSlider {
713                @value: 0.5,
714                @channel: ColorChannel::OkhslHue
715            }
716            AccessibleLabel("Okhsl Hue Channel")
717            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
718                color.okhsl_color.hue = change.value;
719            })
720            --
721            @FeathersColorSlider {
722                @value: 0.5,
723                @channel: ColorChannel::OkhslSaturation
724            }
725            AccessibleLabel("Okhsl Saturation Channel")
726            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
727                color.okhsl_color.saturation = change.value;
728            })
729            --
730            @FeathersColorSlider {
731                @value: 0.5,
732                @channel: ColorChannel::OkhslLightness
733            }
734            AccessibleLabel("Okhsl Lightness Channel")
735            on(|change: On<ValueChange<f32>>, mut color: ResMut<DemoWidgetStates>| {
736                color.okhsl_color.lightness = change.value;
737            })
738        ]
739    }
740}
1.60.0 · Source

pub fn new_cyclic<F>(data_fn: F) -> Arc<T> ⓘ
where F: FnOnce(&Weak<T>) -> T,

Available on non-no_global_oom_handling only.

Constructs a new Arc<T> while giving you a Weak<T> to the allocation, to allow you to construct a T which holds a weak pointer to itself.

Generally, a structure circularly referencing itself, either directly or indirectly, should not hold a strong reference to itself to prevent a memory leak. Using this function, you get access to the weak pointer during the initialization of T, before the Arc<T> is created, such that you can clone and store it inside the T.

new_cyclic first allocates the managed allocation for the Arc<T>, then calls your closure, giving it a Weak<T> to this allocation, and only afterwards completes the construction of the Arc<T> by placing the T returned from your closure into the allocation.

Since the new Arc<T> is not fully-constructed until Arc<T>::new_cyclic returns, calling upgrade on the weak reference inside your closure will fail and result in a None value.

§Panics

If data_fn panics, the panic is propagated to the caller, and the temporary Weak<T> is dropped normally.

§Example
use std::sync::{Arc, Weak};

struct Gadget {
    me: Weak<Gadget>,
}

impl Gadget {
    /// Constructs a reference counted Gadget.
    fn new() -> Arc<Self> {
        // `me` is a `Weak<Gadget>` pointing at the new allocation of the
        // `Arc` we're constructing.
        Arc::new_cyclic(|me| {
            // Create the actual struct here.
            Gadget { me: me.clone() }
        })
    }

    /// Returns a reference counted pointer to Self.
    fn me(&self) -> Arc<Self> {
        self.me.upgrade().unwrap()
    }
}
1.82.0 · Source

pub fn new_uninit() -> Arc<MaybeUninit<T>> ⓘ

Available on non-no_global_oom_handling only.

Constructs a new Arc with uninitialized contents.

§Examples
use std::sync::Arc;

let mut five = Arc::<u32>::new_uninit();

// Deferred initialization:
Arc::get_mut(&mut five).unwrap().write(5);

let five = unsafe { five.assume_init() };

assert_eq!(*five, 5)
1.92.0 · Source

pub fn new_zeroed() -> Arc<MaybeUninit<T>> ⓘ

Available on non-no_global_oom_handling only.

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
use std::sync::Arc;

let zero = Arc::<u32>::new_zeroed();
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0)
1.33.0 · Source

pub fn pin(data: T) -> Pin<Arc<T>>

Available on non-no_global_oom_handling only.

Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then data will be pinned in memory and unable to be moved.

Source

pub fn try_pin(data: T) -> Result<Pin<Arc<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Pin<Arc<T>>, return an error if allocation fails.

Source

pub fn try_new(data: T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc<T>, returning an error if allocation fails.

§Examples
#![feature(allocator_ext)]
use std::sync::Arc;

let five = Arc::try_new(5)?;
Source

pub fn try_new_uninit() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc with uninitialized contents, returning an error if allocation fails.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;

let mut five = Arc::<u32>::try_new_uninit()?;

// Deferred initialization:
Arc::get_mut(&mut five).unwrap().write(5);

let five = unsafe { five.assume_init() };

assert_eq!(*five, 5);
Source

pub fn try_new_zeroed() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, returning an error if allocation fails.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature( allocator_ext)]

use std::sync::Arc;

let zero = Arc::<u32>::try_new_zeroed()?;
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0);
Source§

impl<T, A> Arc<T, A>
where A: Allocator,

Source

pub fn new_in(data: T, alloc: A) -> Arc<T, A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new Arc<T> in the provided allocator.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);
Source

pub fn new_uninit_in(alloc: A) -> Arc<MaybeUninit<T>, A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new Arc with uninitialized contents in the provided allocator.

§Examples
#![feature(get_mut_unchecked)]
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let mut five = Arc::<u32, _>::new_uninit_in(System);

let five = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);

    five.assume_init()
};

assert_eq!(*five, 5)
Source

pub fn new_zeroed_in(alloc: A) -> Arc<MaybeUninit<T>, A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, in the provided allocator.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let zero = Arc::<u32, _>::new_zeroed_in(System);
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0)
Source

pub fn new_cyclic_in<F>(data_fn: F, alloc: A) -> Arc<T, A> ⓘ
where F: FnOnce(&Weak<T, A>) -> T,

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new Arc<T, A> in the given allocator while giving you a Weak<T, A> to the allocation, to allow you to construct a T which holds a weak pointer to itself.

Generally, a structure circularly referencing itself, either directly or indirectly, should not hold a strong reference to itself to prevent a memory leak. Using this function, you get access to the weak pointer during the initialization of T, before the Arc<T, A> is created, such that you can clone and store it inside the T.

new_cyclic_in first allocates the managed allocation for the Arc<T, A>, then calls your closure, giving it a Weak<T, A> to this allocation, and only afterwards completes the construction of the Arc<T, A> by placing the T returned from your closure into the allocation.

Since the new Arc<T, A> is not fully-constructed until Arc<T, A>::new_cyclic_in returns, calling upgrade on the weak reference inside your closure will fail and result in a None value.

§Panics

If data_fn panics, the panic is propagated to the caller, and the temporary Weak<T> is dropped normally.

§Example

See new_cyclic

Source

pub fn pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>
where A: StaticAllocator,

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new Pin<Arc<T, A>> in the provided allocator. If T does not implement Unpin, then data will be pinned in memory and unable to be moved.

Source

pub fn try_pin_in(data: T, alloc: A) -> Result<Pin<Arc<T, A>>, AllocError>
where A: StaticAllocator,

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Pin<Arc<T, A>> in the provided allocator, return an error if allocation fails.

Source

pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc<T, A> in the provided allocator, returning an error if allocation fails.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::try_new_in(5, System)?;
Source

pub fn try_new_uninit_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc with uninitialized contents, in the provided allocator, returning an error if allocation fails.

§Examples
#![feature(allocator_ext)]
#![feature(get_mut_unchecked)]

use std::sync::Arc;
use std::alloc::System;

let mut five = Arc::<u32, _>::try_new_uninit_in(System)?;

let five = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);

    five.assume_init()
};

assert_eq!(*five, 5);
Source

pub fn try_new_zeroed_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, in the provided allocator, returning an error if allocation fails.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let zero = Arc::<u32, _>::try_new_zeroed_in(System)?;
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0);
1.4.0 · Source

pub fn try_unwrap(this: Arc<T, A>) -> Result<T, Arc<T, A>>

Returns the inner value, if the Arc has exactly one strong reference.

Otherwise, an Err is returned with the same Arc that was passed in.

This will succeed even if there are outstanding weak references.

It is strongly recommended to use Arc::into_inner instead if you don’t keep the Arc in the Err case. Immediately dropping the Err-value, as the expression Arc::try_unwrap(this).ok() does, can cause the strong count to drop to zero and the inner value of the Arc to be dropped. For instance, if two threads execute such an expression in parallel, there is a race condition without the possibility of unsafety: The threads could first both check whether they own the last instance in Arc::try_unwrap, determine that they both do not, and then both discard and drop their instance in the call to ok. In this scenario, the value inside the Arc is safely destroyed by exactly one of the threads, but neither thread will ever be able to use the value.

§Examples
use std::sync::Arc;

let x = Arc::new(3);
assert_eq!(Arc::try_unwrap(x), Ok(3));

let x = Arc::new(4);
let _y = Arc::clone(&x);
assert_eq!(*Arc::try_unwrap(x).unwrap_err(), 4);
1.70.0 · Source

pub fn into_inner(this: Arc<T, A>) -> Option<T>

Returns the inner value, if the Arc has exactly one strong reference.

Otherwise, None is returned and the Arc is dropped.

This will succeed even if there are outstanding weak references.

If Arc::into_inner is called on every clone of this Arc, it is guaranteed that exactly one of the calls returns the inner value. This means in particular that the inner value is not dropped.

Arc::try_unwrap is conceptually similar to Arc::into_inner, but it is meant for different use-cases. If used as a direct replacement for Arc::into_inner anyway, such as with the expression Arc::try_unwrap(this).ok(), then it does not give the same guarantee as described in the previous paragraph. For more information, see the examples below and read the documentation of Arc::try_unwrap.

§Examples

Minimal example demonstrating the guarantee that Arc::into_inner gives.

ⓘ
use std::sync::Arc;

let x = Arc::new(3);
let y = Arc::clone(&x);

// Two threads calling `Arc::into_inner` on both clones of an `Arc`:
let x_thread = std::thread::spawn(|| Arc::into_inner(x));
let y_thread = std::thread::spawn(|| Arc::into_inner(y));

let x_inner_value = x_thread.join().unwrap();
let y_inner_value = y_thread.join().unwrap();

// One of the threads is guaranteed to receive the inner value:
assert!(matches!(
    (x_inner_value, y_inner_value),
    (None, Some(3)) | (Some(3), None)
));
// The result could also be `(None, None)` if the threads called
// `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.

A more practical example demonstrating the need for Arc::into_inner:

ⓘ
use std::sync::Arc;

// Definition of a simple singly linked list using `Arc`:
#[derive(Clone)]
struct LinkedList<T>(Option<Arc<Node<T>>>);
struct Node<T>(T, Option<Arc<Node<T>>>);

// Dropping a long `LinkedList<T>` relying on the destructor of `Arc`
// can cause a stack overflow. To prevent this, we can provide a
// manual `Drop` implementation that does the destruction in a loop:
impl<T> Drop for LinkedList<T> {
    fn drop(&mut self) {
        let mut link = self.0.take();
        while let Some(arc_node) = link.take() {
            if let Some(Node(_value, next)) = Arc::into_inner(arc_node) {
                link = next;
            }
        }
    }
}

// Implementation of `new` and `push` omitted
impl<T> LinkedList<T> {
    /* ... */
}

// The following code could have still caused a stack overflow
// despite the manual `Drop` impl if that `Drop` impl had used
// `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.

// Create a long list and clone it
let mut x = LinkedList::new();
let size = 100000;
for i in 0..size {
    x.push(i); // Adds i to the front of x
}
let y = x.clone();

// Drop the clones in parallel
let x_thread = std::thread::spawn(|| drop(x));
let y_thread = std::thread::spawn(|| drop(y));
x_thread.join().unwrap();
y_thread.join().unwrap();
1.100.0 · Source

pub fn map<U>(this: Arc<T, A>, f: impl FnOnce(&T) -> U) -> Arc<U, A> ⓘ

Available on non-no_global_oom_handling only.

Maps the value in an Arc, reusing the allocation if possible.

f is called on a reference to the value in the Arc, and the result is returned, also in an Arc.

Note: this is an associated function, which means that you have to call it as Arc::map(a, f) instead of r.map(a). This is so that there is no conflict with a method on the inner type.

§Examples
use std::sync::Arc;

let r = Arc::new(7);
let new = Arc::map(r, |i| i + 7);
assert_eq!(*new, 14);
Source

pub fn try_map<R>( this: Arc<T, A>, f: impl FnOnce(&T) -> R, ) -> <<R as Try>::Residual as Residual<Arc<<R as Try>::Output, A>>>::TryType
where R: Try, <R as Try>::Residual: Residual<Arc<<R as Try>::Output, A>>,

🔬This is a nightly-only experimental API. (smart_pointer_try_map)
Available on non-no_global_oom_handling only.

Attempts to map the value in an Arc, reusing the allocation if possible.

f is called on a reference to the value in the Arc, and if the operation succeeds, the result is returned, also in an Arc.

Note: this is an associated function, which means that you have to call it as Arc::try_map(a, f) instead of a.try_map(f). This is so that there is no conflict with a method on the inner type.

§Examples
#![feature(smart_pointer_try_map)]

use std::sync::Arc;

let b = Arc::new(7);
let new = Arc::try_map(b, |&i| u32::try_from(i)).unwrap();
assert_eq!(*new, 7);
Source§

impl<T> Arc<[T]>

1.82.0 · Source

pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> ⓘ

Available on non-no_global_oom_handling only.

Constructs a new atomically reference-counted slice with uninitialized contents.

§Examples
use std::sync::Arc;

let mut values = Arc::<[u32]>::new_uninit_slice(3);

// Deferred initialization:
let data = Arc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);

let values = unsafe { values.assume_init() };

assert_eq!(*values, [1, 2, 3])
1.92.0 · Source

pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]> ⓘ

Available on non-no_global_oom_handling only.

Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being filled with 0 bytes.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
use std::sync::Arc;

let values = Arc::<[u32]>::new_zeroed_slice(3);
let values = unsafe { values.assume_init() };

assert_eq!(*values, [0, 0, 0])
Source§

impl<T, A> Arc<[T], A>
where A: Allocator,

Source

pub fn new_uninit_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new atomically reference-counted slice with uninitialized contents in the provided allocator.

§Examples
#![feature(get_mut_unchecked)]
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let mut values = Arc::<[u32], _>::new_uninit_slice_in(3, System);

let values = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
    Arc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
    Arc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);

    values.assume_init()
};

assert_eq!(*values, [1, 2, 3])
Source

pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)
Available on non-no_global_oom_handling only.

Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being filled with 0 bytes, in the provided allocator.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let values = Arc::<[u32], _>::new_zeroed_slice_in(3, System);
let values = unsafe { values.assume_init() };

assert_eq!(*values, [0, 0, 0])
Source

pub fn into_array<const N: usize>(self) -> Result<Arc<[T; N], A>, Arc<[T], A>>

🔬This is a nightly-only experimental API. (alloc_slice_into_array)

Converts the reference-counted slice into a reference-counted array.

This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type.

§Errors

Returns the original Arc<[T]> in the Err variant if self.len() does not equal N.

§Examples
#![feature(alloc_slice_into_array)]
use std::sync::Arc;

let arc_slice: Arc<[i32]> = Arc::new([1, 2, 3]);

let arc_array: Arc<[i32; 3]> = arc_slice.into_array().unwrap();
Source§

impl<T, A> Arc<MaybeUninit<T>, A>
where A: Allocator,

1.82.0 · Source

pub unsafe fn assume_init(self) -> Arc<T, A> ⓘ

Converts to Arc<T>.

§Safety

As with MaybeUninit::assume_init, it is up to the caller to guarantee that the inner value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.

§Examples
use std::sync::Arc;

let mut five = Arc::<u32>::new_uninit();

// Deferred initialization:
Arc::get_mut(&mut five).unwrap().write(5);

let five = unsafe { five.assume_init() };

assert_eq!(*five, 5)
Source§

impl<T> Arc<T>
where T: CloneToUninit + ?Sized,

Source

pub fn clone_from_ref(value: &T) -> Arc<T> ⓘ

🔬This is a nightly-only experimental API. (clone_from_ref)
Available on non-no_global_oom_handling only.

Constructs a new Arc<T> with a clone of value.

§Examples
#![feature(clone_from_ref)]
use std::sync::Arc;

let hello: Arc<str> = Arc::clone_from_ref("hello");
Source

pub fn try_clone_from_ref(value: &T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (clone_from_ref)

Constructs a new Arc<T> with a clone of value, returning an error if allocation fails

§Examples
#![feature(clone_from_ref)]
use std::sync::Arc;

let hello: Arc<str> = Arc::try_clone_from_ref("hello")?;
Source§

impl<T, A> Arc<T, A>
where T: CloneToUninit + ?Sized, A: Allocator,

Source

pub fn clone_from_ref_in(value: &T, alloc: A) -> Arc<T, A> ⓘ

🔬This is a nightly-only experimental API. (clone_from_ref)
Available on non-no_global_oom_handling only.

Constructs a new Arc<T> with a clone of value in the provided allocator.

§Examples
#![feature(clone_from_ref)]
#![feature(allocator_ext)]
use std::sync::Arc;
use std::alloc::System;

let hello: Arc<str, System> = Arc::clone_from_ref_in("hello", System);
Source

pub fn try_clone_from_ref_in( value: &T, alloc: A, ) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (clone_from_ref)

Constructs a new Arc<T> with a clone of value in the provided allocator, returning an error if allocation fails

§Examples
#![feature(clone_from_ref)]
#![feature(allocator_ext)]
use std::sync::Arc;
use std::alloc::System;

let hello: Arc<str, System> = Arc::try_clone_from_ref_in("hello", System)?;
Source§

impl<T, A> Arc<[MaybeUninit<T>], A>
where A: Allocator,

1.82.0 · Source

pub unsafe fn assume_init(self) -> Arc<[T], A> ⓘ

Converts to Arc<[T]>.

§Safety

As with MaybeUninit::assume_init, it is up to the caller to guarantee that the inner value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.

§Examples
use std::sync::Arc;

let mut values = Arc::<[u32]>::new_uninit_slice(3);

// Deferred initialization:
let data = Arc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);

let values = unsafe { values.assume_init() };

assert_eq!(*values, [1, 2, 3])
Source§

impl<T> Arc<T>
where T: ?Sized,

1.17.0 · Source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T> ⓘ

Constructs an Arc<T> from a raw pointer.

The raw pointer must have been previously returned by a call to Arc<U>::into_raw or Arc<U>::into_raw_with_allocator.

§Safety
  • Creating a Arc<T> from a pointer other than one returned from Arc<U>::into_raw or Arc<U>::into_raw_with_allocator is undefined behavior.
  • If U is sized, it must have the same size and alignment as T. This is trivially true if U is T.
  • If U is unsized, its data pointer must have the same size and alignment as T. This is trivially true if Arc<U> was constructed through Arc<T> and then converted to Arc<U> through an unsized coercion.
  • Note that if U or U’s data pointer is not T but has the same size and alignment, this is basically like transmuting references of different types. See mem::transmute for more information on what restrictions apply in this case.
  • The raw pointer must point to a block of memory allocated by the global allocator.
  • The user of from_raw has to make sure a specific value of T is only dropped once.

This function is unsafe because improper use may lead to memory unsafety, even if the returned Arc<T> is never accessed.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let x_ptr = Arc::into_raw(x);

unsafe {
    // Convert back to an `Arc` to prevent leak.
    let x = Arc::from_raw(x_ptr);
    assert_eq!(&*x, "hello");

    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
}

// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!

Convert a slice back into its original array:

use std::sync::Arc;

let x: Arc<[u32]> = Arc::new([1, 2, 3]);
let x_ptr: *const [u32] = Arc::into_raw(x);

unsafe {
    let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
    assert_eq!(&*x, &[1, 2, 3]);
}
1.17.0 · Source

pub fn into_raw(this: Arc<T>) -> *const T

Consumes the Arc, returning the wrapped pointer.

To avoid a memory leak the pointer must be converted back to an Arc using Arc::from_raw.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let x_ptr = Arc::into_raw(x);
assert_eq!(unsafe { &*x_ptr }, "hello");
1.51.0 · Source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method, and ptr must point to a block of memory allocated by the global allocator.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count(ptr);

    // This assertion is deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw(ptr);
    assert_eq!(2, Arc::strong_count(&five));
}
1.51.0 · Source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method, and ptr must point to a block of memory allocated by the global allocator. This method can be used to release the final Arc and backing storage, but should not be called after the final Arc has been released.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count(ptr);

    // Those assertions are deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw(ptr);
    assert_eq!(2, Arc::strong_count(&five));
    Arc::decrement_strong_count(ptr);
    assert_eq!(1, Arc::strong_count(&five));
}
Source

pub unsafe fn strong_count_from_raw(ptr: *const T) -> usize

🔬This is a nightly-only experimental API. (arc_raw_get_strong)

Gets the number of strong (Arc) pointers to the allocation behind the given raw pointer.

This method does not consume or drop the Arc behind this pointer.

§Safety

The pointer must point to (and have valid metadata for) the value inside a live Arc allocation, such as a pointer returned by Arc::into_raw, Arc::into_raw_with_allocator, or Arc::as_ptr. T must have the same alignment as that value. The associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method.

Using this method correctly also requires extra care: another thread can change the strong count at any time, including between calling this method and acting on the result.

§Examples
#![feature(arc_raw_get_strong)]
use std::sync::Arc;

let five = Arc::new(5);
let _also_five = Arc::clone(&five);
let ptr = Arc::into_raw(five);

unsafe {
    // This assertion is deterministic because we haven't shared
    // the `Arc` between threads.
    assert_eq!(2, Arc::strong_count_from_raw(ptr));

    // Convert back to an `Arc` to avoid leaking memory.
    let five = Arc::from_raw(ptr);
    assert_eq!(2, Arc::strong_count(&five));
}
Source§

impl<T, A> Arc<T, A>
where A: Allocator, T: ?Sized,

Source

pub fn allocator(this: &Arc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_ext)

Returns a reference to the underlying allocator.

Note: this is an associated function, which means that you have to call it as Arc::allocator(&a) instead of a.allocator(). This is so that there is no conflict with a method on the inner type.

Source

pub fn into_raw_with_allocator(this: Arc<T, A>) -> (*const T, A)

🔬This is a nightly-only experimental API. (allocator_ext)

Consumes the Arc, returning the wrapped pointer and allocator.

To avoid a memory leak the pointer must be converted back to an Arc using Arc::from_raw_in.

§Examples
#![feature(allocator_ext)]
use std::sync::Arc;
use std::alloc::System;

let x = Arc::new_in("hello".to_owned(), System);
let (ptr, alloc) = Arc::into_raw_with_allocator(x);
assert_eq!(unsafe { &*ptr }, "hello");
let x = unsafe { Arc::from_raw_in(ptr, alloc) };
assert_eq!(&*x, "hello");
1.45.0 · Source

pub fn as_ptr(this: &Arc<T, A>) -> *const T

Provides a raw pointer to the data.

The counts are not affected in any way and the Arc is not consumed. The pointer is valid for as long as there are strong counts in the Arc.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let y = Arc::clone(&x);
let x_ptr = Arc::as_ptr(&x);
assert_eq!(x_ptr, Arc::as_ptr(&y));
assert_eq!(unsafe { &*x_ptr }, "hello");
Source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Arc<T, A> ⓘ

🔬This is a nightly-only experimental API. (allocator_ext)

Constructs an Arc<T, A> from a raw pointer.

The raw pointer must have been previously returned by a call to Arc<U, A>::into_raw or Arc<U, A>::into_raw_with_allocator.

§Safety
  • Creating a Arc<T, A> from a pointer other than one returned from Arc<U, A>::into_raw or Arc<U, A>::into_raw_with_allocator is undefined behavior.
  • If U is sized, it must have the same size and alignment as T. This is trivially true if U is T.
  • If U is unsized, its data pointer must have the same size and alignment as T. This is trivially true if Arc<U, A> was constructed through Arc<T, A> and then converted to Arc<U, A> through an unsized coercion.
  • Note that if U or U’s data pointer is not T but has the same size and alignment, this is basically like transmuting references of different types. See mem::transmute for more information on what restrictions apply in this case.
  • The raw pointer must point to a block of memory allocated by alloc
  • The user of from_raw has to make sure a specific value of T is only dropped once.

This function is unsafe because improper use may lead to memory unsafety, even if the returned Arc<T> is never accessed.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let x = Arc::new_in("hello".to_owned(), System);
let (x_ptr, alloc) = Arc::into_raw_with_allocator(x);

unsafe {
    // Convert back to an `Arc` to prevent leak.
    let x = Arc::from_raw_in(x_ptr, System);
    assert_eq!(&*x, "hello");

    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
}

// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!

Convert a slice back into its original array:

#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
let x_ptr: *const [u32] = Arc::into_raw_with_allocator(x).0;

unsafe {
    let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
    assert_eq!(&*x, &[1, 2, 3]);
}
1.4.0 · Source

pub fn downgrade(this: &Arc<T, A>) -> Weak<T, A>
where A: AllocatorClone,

Creates a new Weak pointer to this allocation.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

let weak_five = Arc::downgrade(&five);
1.15.0 · Source

pub fn weak_count(this: &Arc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

§Safety

This method by itself is safe, but using it correctly requires extra care. Another thread can change the weak count at any time, including potentially between calling this method and acting on the result.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let _weak_five = Arc::downgrade(&five);

// This assertion is deterministic because we haven't shared
// the `Arc` or `Weak` between threads.
assert_eq!(1, Arc::weak_count(&five));
1.15.0 · Source

pub fn strong_count(this: &Arc<T, A>) -> usize

Gets the number of strong (Arc) pointers to this allocation.

§Safety

This method by itself is safe, but using it correctly requires extra care. Another thread can change the strong count at any time, including potentially between calling this method and acting on the result.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let _also_five = Arc::clone(&five);

// This assertion is deterministic because we haven't shared
// the `Arc` between threads.
assert_eq!(2, Arc::strong_count(&five));
Source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where A: AllocatorClone,

🔬This is a nightly-only experimental API. (allocator_ext)

Increments the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method, and ptr must point to a block of memory allocated by alloc.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);

unsafe {
    let (ptr, _alloc) = Arc::into_raw_with_allocator(five);
    Arc::increment_strong_count_in(ptr, System);

    // This assertion is deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw_in(ptr, System);
    assert_eq!(2, Arc::strong_count(&five));
}
Source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_ext)

Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method, and ptr must point to a block of memory allocated by alloc. This method can be used to release the final Arc and backing storage, but should not be called after the final Arc has been released.

§Examples
#![feature(allocator_ext)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);

unsafe {
    let (ptr, _alloc) = Arc::into_raw_with_allocator(five);
    Arc::increment_strong_count_in(ptr, System);

    // Those assertions are deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw_in(ptr, System);
    assert_eq!(2, Arc::strong_count(&five));
    Arc::decrement_strong_count_in(ptr, System);
    assert_eq!(1, Arc::strong_count(&five));
}
1.17.0 · Source

pub fn ptr_eq(this: &Arc<T, A>, other: &Arc<T, A>) -> bool

Returns true if the two Arcs point to the same allocation in a vein similar to ptr::eq. This function ignores the metadata of dyn Trait pointers.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let same_five = Arc::clone(&five);
let other_five = Arc::new(5);

assert!(Arc::ptr_eq(&five, &same_five));
assert!(!Arc::ptr_eq(&five, &other_five));
Source§

impl<T, A> Arc<T, A>

1.4.0 · Source

pub fn make_mut(this: &mut Arc<T, A>) -> &mut T

Available on non-no_global_oom_handling only.

Makes a mutable reference into the given Arc.

If there are other Arc pointers to the same allocation, then make_mut will clone the inner value to a new allocation to ensure unique ownership. This is also referred to as clone-on-write.

However, if there are no other Arc pointers to this allocation, but some Weak pointers, then the Weak pointers will be dissociated and the inner value will not be cloned.

See also get_mut, which will fail rather than cloning the inner value or dissociating Weak pointers.

§Examples
use std::sync::Arc;

let mut data = Arc::new(5);

*Arc::make_mut(&mut data) += 1;         // Won't clone anything
let mut other_data = Arc::clone(&data); // Won't clone inner data
*Arc::make_mut(&mut data) += 1;         // Clones inner data
*Arc::make_mut(&mut data) += 1;         // Won't clone anything
*Arc::make_mut(&mut other_data) *= 2;   // Won't clone anything

// Now `data` and `other_data` point to different allocations.
assert_eq!(*data, 8);
assert_eq!(*other_data, 12);

Weak pointers will be dissociated:

use std::sync::Arc;

let mut data = Arc::new(75);
let weak = Arc::downgrade(&data);

assert!(75 == *data);
assert!(75 == *weak.upgrade().unwrap());

*Arc::make_mut(&mut data) += 1;

assert!(76 == *data);
assert!(weak.upgrade().is_none());
Source§

impl<T, A> Arc<T, A>
where T: Clone, A: Allocator,

1.76.0 · Source

pub fn unwrap_or_clone(this: Arc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the clone.

Assuming arc_t is of type Arc<T>, this function is functionally equivalent to (*arc_t).clone(), but will avoid cloning the inner value where possible.

§Examples
let inner = String::from("test");
let ptr = inner.as_ptr();

let arc = Arc::new(inner);
let inner = Arc::unwrap_or_clone(arc);
// The inner value was not cloned
assert!(ptr::eq(ptr, inner.as_ptr()));

let arc = Arc::new(inner);
let arc2 = arc.clone();
let inner = Arc::unwrap_or_clone(arc);
// Because there were 2 references, we had to clone the inner value.
assert!(!ptr::eq(ptr, inner.as_ptr()));
// `arc2` is the last reference, so when we unwrap it we get back
// the original `String`.
let inner = Arc::unwrap_or_clone(arc2);
assert!(ptr::eq(ptr, inner.as_ptr()));
Source§

impl<T, A> Arc<T, A>
where A: Allocator, T: ?Sized,

1.4.0 · Source

pub fn get_mut(this: &mut Arc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Arc, if there are no other Arc or Weak pointers to the same allocation.

Returns None otherwise, because it is not safe to mutate a shared value.

See also make_mut, which will clone the inner value when there are other Arc pointers.

§Examples
use std::sync::Arc;

let mut x = Arc::new(3);
*Arc::get_mut(&mut x).unwrap() = 4;
assert_eq!(*x, 4);

let _y = Arc::clone(&x);
assert!(Arc::get_mut(&mut x).is_none());
Source

pub unsafe fn get_mut_unchecked(this: &mut Arc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked)

Returns a mutable reference into the given Arc, without any check.

See also get_mut, which is safe and does appropriate checks.

§Safety

If any other Arc or Weak pointers to the same allocation exist, then they must not be dereferenced or have active borrows for the duration of the returned borrow, and their inner type must be exactly the same as the inner type of this Arc (including lifetimes). This is trivially the case if no such pointers exist, for example immediately after Arc::new.

§Examples
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut x = Arc::new(String::new());
unsafe {
    Arc::get_mut_unchecked(&mut x).push_str("foo")
}
assert_eq!(*x, "foo");

Other Arc pointers to the same allocation must be to the same type.

#![feature(get_mut_unchecked)]

use std::sync::Arc;

let x: Arc<str> = Arc::from("Hello, world!");
let mut y: Arc<[u8]> = x.clone().into();
unsafe {
    // this is Undefined Behavior, because x's inner type is str, not [u8]
    Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8
}
println!("{}", &*x); // Invalid UTF-8 in a str

Other Arc pointers to the same allocation must be to the exact same type, including lifetimes.

#![feature(get_mut_unchecked)]

use std::sync::Arc;

let x: Arc<&str> = Arc::new("Hello, world!");
{
    let s = String::from("Oh, no!");
    let mut y: Arc<&str> = x.clone();
    unsafe {
        // this is Undefined Behavior, because x's inner type
        // is &'long str, not &'short str
        *Arc::get_mut_unchecked(&mut y) = &s;
    }
}
println!("{}", &*x); // Use-after-free
1.101.0 · Source

pub fn is_unique(this: &Arc<T, A>) -> bool

Determine whether this is the unique reference to the underlying data.

Returns true if there are no other Arc or Weak pointers to the same allocation; returns false otherwise.

If this function returns true, then it is guaranteed to be safe to call get_mut_unchecked on this Arc, as long as no clones occur in between.

The result can become stale if another thread can call clone or downgrade through a shared reference. Make sure you have exclusive access to the Arc.

§Examples
use std::sync::Arc;

let x = Arc::new(3);
assert!(Arc::is_unique(&x));

let y = Arc::clone(&x);
assert!(!Arc::is_unique(&x));
drop(y);

// Weak references also count, because they could be upgraded at any time.
let z = Arc::downgrade(&x);
assert!(!Arc::is_unique(&x));
§Pointer invalidation

This function will always return the same value as Arc::get_mut(arc).is_some(). However, unlike that operation it does not produce any mutable references to the underlying data, meaning no pointers to the data inside the Arc are invalidated by the call. Thus, the following code is valid:

use std::sync::Arc;

let arc = Arc::new(5);
let pointer: *const i32 = &*arc;
assert!(Arc::is_unique(&arc));
assert_eq!(unsafe { *pointer }, 5);

The following changes would make the example unsound:

  • Using Arc::get_mut to create a mutable reference while also accessing the value through pointer.
  • Dropping arc before dereferencing pointer, leaving it dangling.
§Atomic orderings

Concurrent drops to other Arc pointers to the same allocation will synchronize with this call - that is, this call performs an Acquire operation on the underlying strong and weak ref counts. This ensures that calling get_mut_unchecked is safe.

Note that this operation requires locking the weak ref count, so concurrent calls to downgrade may spin-loop for a short period of time.

Source§

impl<A> Arc<dyn Any + Send + Sync, A>
where A: Allocator,

1.29.0 · Source

pub fn downcast<T>(self) -> Result<Arc<T, A>, Arc<dyn Any + Send + Sync, A>>
where T: Any + Send + Sync,

Attempts to downcast the Arc<dyn Any + Send + Sync> to a concrete type.

§Examples
use std::any::Any;
use std::sync::Arc;

fn print_if_string(value: Arc<dyn Any + Send + Sync>) {
    if let Ok(string) = value.downcast::<String>() {
        println!("String ({}): {}", string.len(), string);
    }
}

let my_string = "Hello World".to_string();
print_if_string(Arc::new(my_string));
print_if_string(Arc::new(0i8));
Source

pub unsafe fn downcast_unchecked<T>(self) -> Arc<T, A> ⓘ
where T: Any + Send + Sync,

🔬This is a nightly-only experimental API. (downcast_unchecked)

Downcasts the Arc<dyn Any + Send + Sync> to a concrete type.

For a safe alternative see downcast.

§Examples
#![feature(downcast_unchecked)]

use std::any::Any;
use std::sync::Arc;

let x: Arc<dyn Any + Send + Sync> = Arc::new(1_usize);

unsafe {
    assert_eq!(*x.downcast_unchecked::<usize>(), 1);
}
§Safety

The contained value must be of type T. Calling this method with the incorrect type is undefined behavior.

Trait Implementations§

1.100.0 · Source§

impl<T, A> Allocator for Arc<T, A>
where T: Allocator + ?Sized, A: Allocator,

Source§

fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>

Attempts to allocate a block of memory. Read more
Source§

fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>

Behaves like allocate, but also ensures that the returned memory is zero-initialized. Read more
Source§

unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)

Deallocates the memory referenced by ptr. Read more
Source§

unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>

Attempts to extend the memory block. Read more
Source§

unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>

Behaves like grow, but also ensures that the new contents are set to zero before being returned. Read more
Source§

unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>

Attempts to shrink the memory block. Read more
Source§

impl<T, A> AllocatorClone for Arc<T, A>
where T: Allocator + ?Sized, A: AllocatorClone,

Source§

impl<T, A> AllocatorNightly for Arc<T, A>
where T: Allocator + ?Sized, A: Allocator,

1.64.0 · Source§

impl<T> AsFd for Arc<T>
where T: AsFd + ?Sized,

This impl allows implementing traits that require AsFd on Arc.

use std::net::UdpSocket;
use std::sync::Arc;

trait MyTrait: AsFd {}
impl MyTrait for Arc<UdpSocket> {}
impl MyTrait for Box<UdpSocket> {}
Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
1.63.0 · Source§

impl<T> AsRawFd for Arc<T>
where T: AsRawFd,

This impl allows implementing traits that require AsRawFd on Arc.

use std::net::UdpSocket;
use std::sync::Arc;
trait MyTrait: AsRawFd {
}
impl MyTrait for Arc<UdpSocket> {}
impl MyTrait for Box<UdpSocket> {}
Source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
Source§

impl<T> AsRawXcbConnection for Arc<T>

Available on crate feature alloc only.
Source§

fn as_raw_xcb_connection(&self) -> *mut xcb_connection_t

Get a raw xcb connection pointer from this object.
1.5.0 · Source§

impl<T, A> AsRef<T> for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Basic for Arc<T>
where T: Basic + ?Sized,

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

The type signature, as a character.
Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

The type signature, as a string.
Source§

fn alignment(format: Format) -> usize

The required padding alignment for the given format. Read more
1.0.0 · Source§

impl<T, A> Borrow<T> for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<M, P> BoundDataProvider<M> for Arc<P>

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

fn load_bound(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
Source§

fn bound_marker(&self) -> DataMarkerInfo

Returns the DataMarkerInfo that this provider uses for loading data.
Source§

impl<T> BufferRef for Arc<T>
where T: BufferRef + ?Sized,

Source§

fn len(&self) -> usize

Source§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

Source§

fn read_slice(&self, offset: usize, val: &mut [u8])

Source§

impl<T> CalculateSizeFor for Arc<T>
where T: CalculateSizeFor + ?Sized,

Source§

fn calculate_size_for(nr_of_el: u64) -> NonZero<u64>

Returns the size of Self assuming the (contained) runtime-sized array has nr_of_el elements
Source§

impl<T> CartablePointerLike for Arc<T>

Available on crate feature alloc only.
1.0.0 · Source§

impl<T, A> Clone for Arc<T, A>
where A: AllocatorClone, T: ?Sized,

Source§

fn clone(&self) -> Arc<T, A> ⓘ

Makes a clone of the Arc pointer.

This creates another pointer to the same allocation, increasing the strong reference count.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

let _ = Arc::clone(&five);
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> CloneFromCell for Arc<T>
where T: ?Sized,

Source§

impl<T> CloneStableDeref for Arc<T>
where T: ?Sized,

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

impl<T> CloneableCart for Arc<T>
where T: ?Sized,

Available on crate feature alloc only.
Source§

impl<T> CloneableCartablePointerLike for Arc<T>

Available on crate feature alloc only.
Source§

impl<T, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where T: Unsize<U> + ?Sized, A: Allocator, U: ?Sized,

Source§

impl<C> Connection for Arc<C>
where C: Connection + ?Sized,

Source§

fn wait_for_event(&self) -> Result<Event, ConnectionError>

Wait for a new event from the X11 server.
Source§

fn wait_for_raw_event( &self, ) -> Result<<Arc<C> as RequestConnection>::Buf, ConnectionError>

Wait for a new raw/unparsed event from the X11 server.
Source§

fn wait_for_event_with_sequence(&self) -> Result<(Event, u64), ConnectionError>

Wait for a new event from the X11 server.
Source§

fn wait_for_raw_event_with_sequence( &self, ) -> Result<(<Arc<C> as RequestConnection>::Buf, u64), ConnectionError>

Wait for a new raw/unparsed event from the X11 server.
Source§

fn poll_for_event(&self) -> Result<Option<Event>, ConnectionError>

Poll for a new event from the X11 server.
Source§

fn poll_for_raw_event( &self, ) -> Result<Option<<Arc<C> as RequestConnection>::Buf>, ConnectionError>

Poll for a new raw/unparsed event from the X11 server.
Source§

fn poll_for_event_with_sequence( &self, ) -> Result<Option<(Event, u64)>, ConnectionError>

Poll for a new event from the X11 server.
Source§

fn poll_for_raw_event_with_sequence( &self, ) -> Result<Option<(<Arc<C> as RequestConnection>::Buf, u64)>, ConnectionError>

Poll for a new unparsed/raw event from the X11 server.
Source§

fn flush(&self) -> Result<(), ConnectionError>

Send all pending requests to the server. Read more
Source§

fn setup(&self) -> &Setup

Get the setup information sent by the X11 server. Read more
Source§

fn generate_id(&self) -> Result<u32, ReplyOrIdError>

Generate a new X11 identifier. Read more
Source§

impl<T> ContainsEntity for Arc<T>
where T: ContainsEntity,

Source§

fn entity(&self) -> Entity

Returns the contained entity.
Source§

impl<T> CreateFrom for Arc<T>
where T: CreateFrom + ?Sized,

Source§

fn create_from<B>(reader: &mut Reader<B>) -> Arc<T> ⓘ
where B: BufferRef,

Source§

impl<M, P> DataProvider<M> for Arc<P>
where M: DataMarker, P: DataProvider<M> + ?Sized,

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
1.0.0 · Source§

impl<T, A> Debug for Arc<T, A>
where T: Debug + ?Sized, A: Allocator,

Source§

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

Formats the value using the given formatter. Read more
1.0.0 · Source§

impl<T> Default for Arc<T>
where T: Default,

Available on non-no_global_oom_handling only.
Source§

fn default() -> Arc<T> ⓘ

Creates a new Arc<T>, with the Default value for T.

§Examples
use std::sync::Arc;

let x: Arc<i32> = Default::default();
assert_eq!(*x, 0);
1.80.0 · Source§

impl Default for Arc<str>

Available on non-no_global_oom_handling only.
Source§

fn default() -> Arc<str> ⓘ

Creates an empty str inside an Arc

This may or may not share an allocation with other Arcs.

1.80.0 · Source§

impl Default for Arc<CStr>

Available on non-no_global_oom_handling only.
Source§

fn default() -> Arc<CStr> ⓘ

Creates an empty CStr inside an Arc

This may or may not share an allocation with other Arcs.

1.80.0 · Source§

impl<T> Default for Arc<[T]>

Available on non-no_global_oom_handling only.
Source§

fn default() -> Arc<[T]> ⓘ

Creates an empty [T] inside an Arc

This may or may not share an allocation with other Arcs.

1.91.0 · Source§

impl<T> Default for Pin<Arc<T>>
where Arc<T>: Default, T: ?Sized,

Available on non-no_global_oom_handling only.
Source§

fn default() -> Pin<Arc<T>>

Returns the “default value” for a type. Read more
1.0.0 · Source§

impl<T, A> Deref for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T, A> DerefPure for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>
where T: Unsize<U> + ?Sized, U: ?Sized,

1.0.0 · Source§

impl<T, A> Display for Arc<T, A>
where T: Display + ?Sized, A: Allocator,

Source§

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

Formats the value using the given formatter. Read more
1.0.0 · Source§

impl<T, A> Drop for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn drop(&mut self)

Drops the Arc.

This will decrement the strong reference count. If the strong reference count reaches zero then the only other references (if any) are Weak, so we drop the inner value.

§Examples
use std::sync::Arc;

struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {
        println!("dropped!");
    }
}

let foo  = Arc::new(Foo);
let foo2 = Arc::clone(&foo);

drop(foo);    // Doesn't print anything
drop(foo2);   // Prints "dropped!"
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<M, P> DryDataProvider<M> for Arc<P>
where M: DataMarker, P: DryDataProvider<M> + ?Sized,

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

fn dry_load( &self, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>

This method goes through the motions of load, but only returns the metadata. Read more
Source§

impl<M, P> DynamicDataProvider<M> for Arc<P>

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

fn load_data( &self, marker: DataMarkerInfo, req: DataRequest<'_>, ) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
Source§

impl<M, P> DynamicDryDataProvider<M> for Arc<P>

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

fn dry_load_data( &self, marker: DataMarkerInfo, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>

This method goes through the motions of load_data, but only returns the metadata. Read more
Source§

impl<Out, F> EntityCommand for Arc<F>
where F: Fn(EntityWorldMut<'_>) -> Out + Send + Sync + 'static + ?Sized, Out: EntityCommandOutput + 'static,

Source§

type Out = Out

The return type of apply.
Source§

fn apply(self, entity: EntityWorldMut<'_>) -> <Arc<F> as EntityCommand>::Out ⓘ

Executes this command for the given Entity.
Source§

fn with_entity(self, entity: Entity) -> impl Command
where Self: Sized,

Passes in a specific entity to an EntityCommand, resulting in a Command that internally runs the EntityCommand on that entity.
Source§

impl<T> EntityEquivalent for Arc<T>

1.0.0 · Source§

impl<T, A> Eq for Arc<T, A>
where T: Eq + ?Sized, A: Allocator,

1.52.0 · Source§

impl<T> Error for Arc<T>
where T: Error + ?Sized,

Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
Source§

fn provide<'a>(&'a self, req: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

Source§

impl<S> Filter<S> for Arc<dyn Filter<S> + Send + Sync>

Available on crate feature registry only.
Source§

fn enabled(&self, meta: &Metadata<'_>, cx: &Context<'_, S>) -> bool

Returns true if this layer is interested in a span or event with the given Metadata in the current Context, similarly to Subscriber::enabled. Read more
Source§

fn callsite_enabled(&self, meta: &'static Metadata<'static>) -> Interest

Returns an Interest indicating whether this layer will always, sometimes, or never be interested in the given Metadata. Read more
Source§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns an optional hint of the highest verbosity level that this Filter will enable. Read more
Source§

fn event_enabled(&self, event: &Event<'_>, cx: &Context<'_, S>) -> bool

Called before the filtered [Layer]'s [on_event], to determine if on_event` should be called. Read more
Source§

fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a new span was constructed with the given Attributes and Id. Read more
Source§

fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>)

Notifies this filter that a span with the given Id recorded the given values. Read more
Source§

fn on_enter(&self, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID was entered. Read more
Source§

fn on_exit(&self, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID was exited. Read more
Source§

fn on_close(&self, id: Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID has been closed. Read more
1.24.0 · Source§

impl From<&CStr> for Arc<CStr>

Available on target_has_atomic=ptr only.
Source§

fn from(s: &CStr) -> Arc<CStr> ⓘ

Converts a &CStr into a Arc<CStr>, by copying the contents into a newly allocated Arc.

1.24.0 · Source§

impl From<&OsStr> for Arc<OsStr>

Source§

fn from(s: &OsStr) -> Arc<OsStr> ⓘ

Copies the string into a newly allocated Arc<OsStr>.

1.24.0 · Source§

impl From<&Path> for Arc<Path>

Source§

fn from(s: &Path) -> Arc<Path> ⓘ

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

Source§

impl<T> From<&UniqueEntityEquivalentSlice<T>> for Arc<UniqueEntityEquivalentSlice<T>>

Source§

fn from( value: &UniqueEntityEquivalentSlice<T>, ) -> Arc<UniqueEntityEquivalentSlice<T>> ⓘ

Converts to this type from the input type.
1.21.0 · Source§

impl<T> From<&[T]> for Arc<[T]>
where T: Clone,

Available on non-no_global_oom_handling only.
Source§

fn from(v: &[T]) -> Arc<[T]> ⓘ

Allocates a reference-counted slice and fills it by cloning v’s items.

§Example
let original: &[i32] = &[1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
1.84.0 · Source§

impl From<&mut CStr> for Arc<CStr>

Available on target_has_atomic=ptr only.
Source§

fn from(s: &mut CStr) -> Arc<CStr> ⓘ

Converts a &mut CStr into a Arc<CStr>, by copying the contents into a newly allocated Arc.

1.84.0 · Source§

impl From<&mut OsStr> for Arc<OsStr>

Source§

fn from(s: &mut OsStr) -> Arc<OsStr> ⓘ

Copies the string into a newly allocated Arc<OsStr>.

1.84.0 · Source§

impl From<&mut Path> for Arc<Path>

Source§

fn from(s: &mut Path) -> Arc<Path> ⓘ

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

1.84.0 · Source§

impl<T> From<&mut [T]> for Arc<[T]>
where T: Clone,

Available on non-no_global_oom_handling only.
Source§

fn from(v: &mut [T]) -> Arc<[T]> ⓘ

Allocates a reference-counted slice and fills it by cloning v’s items.

§Example
let mut original = [1, 2, 3];
let original: &mut [i32] = &mut original;
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
1.84.0 · Source§

impl From<&mut str> for Arc<str>

Available on non-no_global_oom_handling only.
Source§

fn from(v: &mut str) -> Arc<str> ⓘ

Allocates a reference-counted str and copies v into it.

§Example
let mut original = String::from("eggplant");
let original: &mut str = &mut original;
let shared: Arc<str> = Arc::from(original);
assert_eq!("eggplant", &shared[..]);
1.21.0 · Source§

impl From<&str> for Arc<str>

Available on non-no_global_oom_handling only.
Source§

fn from(v: &str) -> Arc<str> ⓘ

Allocates a reference-counted str and copies v into it.

§Example
let shared: Arc<str> = Arc::from("eggplant");
assert_eq!("eggplant", &shared[..]);
Source§

impl From<Arc<ByteStr>> for Arc<[u8]>

Available on target_has_atomic=ptr and non-no_rc and non-no_sync only.
Source§

fn from(s: Arc<ByteStr>) -> Arc<[u8]> ⓘ

Converts to this type from the input type.
Source§

impl From<Arc<[u8]>> for Arc<ByteStr>

Available on target_has_atomic=ptr and non-no_rc and non-no_sync only.
Source§

fn from(s: Arc<[u8]>) -> Arc<ByteStr> ⓘ

Converts to this type from the input type.
1.62.0 · Source§

impl From<Arc<str>> for Arc<[u8]>

Source§

fn from(rc: Arc<str>) -> Arc<[u8]> ⓘ

Converts an atomically reference-counted string slice into a byte slice.

§Example
let string: Arc<str> = Arc::from("eggplant");
let bytes: Arc<[u8]> = Arc::from(string);
assert_eq!("eggplant".as_bytes(), bytes.as_ref());
1.21.0 · Source§

impl<T, A> From<Box<T, A>> for Arc<T, A>
where A: AllocatorNightly, T: ?Sized,

Available on non-no_global_oom_handling only.
Source§

fn from(v: Box<T, A>) -> Arc<T, A> ⓘ

Move a boxed object to a new, reference-counted allocation.

§Example
let unique: Box<str> = Box::from("eggplant");
let shared: Arc<str> = Arc::from(unique);
assert_eq!("eggplant", &shared[..]);
1.24.0 · Source§

impl From<CString> for Arc<CStr>

Available on target_has_atomic=ptr only.
Source§

fn from(s: CString) -> Arc<CStr> ⓘ

Converts a CString into an Arc<CStr> by moving the CString data into a new Arc buffer.

1.45.0 · Source§

impl<'a, B> From<Cow<'a, B>> for Arc<B>
where B: ToOwned + ?Sized, Arc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

Source§

fn from(cow: Cow<'a, B>) -> Arc<B> ⓘ

Creates an atomically reference-counted pointer from a clone-on-write pointer by copying its content.

§Example
let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
let shared: Arc<str> = Arc::from(cow);
assert_eq!("eggplant", &shared[..]);
1.24.0 · Source§

impl From<OsString> for Arc<OsStr>

Source§

fn from(s: OsString) -> Arc<OsStr> ⓘ

Converts an OsString into an Arc<OsStr> by moving the OsString data into a new Arc buffer.

1.24.0 · Source§

impl From<PathBuf> for Arc<Path>

Source§

fn from(s: PathBuf) -> Arc<Path> ⓘ

Converts a PathBuf into an Arc<Path> by moving the PathBuf data into a new Arc buffer.

Source§

impl From<SmolStr> for Arc<str>

Source§

fn from(text: SmolStr) -> Arc<str> ⓘ

Converts to this type from the input type.
1.21.0 · Source§

impl From<String> for Arc<str>

Available on non-no_global_oom_handling only.
Source§

fn from(v: String) -> Arc<str> ⓘ

Allocates a reference-counted str and copies v into it.

§Example
let unique: String = "eggplant".to_owned();
let shared: Arc<str> = Arc::from(unique);
assert_eq!("eggplant", &shared[..]);
1.6.0 · Source§

impl<T> From<T> for Arc<T>

Available on non-no_global_oom_handling only.
Source§

fn from(t: T) -> Arc<T> ⓘ

Converts a T into an Arc<T>

The conversion moves the value into a newly allocated Arc. It is equivalent to calling Arc::new(t).

§Example
let x = 5;
let arc = Arc::new(5);

assert_eq!(Arc::from(x), arc);
Source§

impl<T> From<UniqueEntityEquivalentVec<T>> for Arc<[T]>

Source§

fn from(value: UniqueEntityEquivalentVec<T>) -> Arc<[T]> ⓘ

Converts to this type from the input type.
Source§

impl<T> From<UniqueEntityEquivalentVec<T>> for Arc<UniqueEntityEquivalentSlice<T>>

Source§

fn from( value: UniqueEntityEquivalentVec<T>, ) -> Arc<UniqueEntityEquivalentSlice<T>> ⓘ

Converts to this type from the input type.
1.21.0 · Source§

impl<T, A> From<Vec<T, A>> for Arc<[T], A>

Available on non-no_global_oom_handling only.
Source§

fn from(v: Vec<T, A>) -> Arc<[T], A> ⓘ

Allocates a reference-counted slice and moves v’s items into it.

§Example
let unique: Vec<i32> = vec![1, 2, 3];
let shared: Arc<[i32]> = Arc::from(unique);
assert_eq!(&[1, 2, 3], &shared[..]);
1.74.0 · Source§

impl<T, const N: usize> From<[T; N]> for Arc<[T]>

Available on non-no_global_oom_handling only.
Source§

fn from(v: [T; N]) -> Arc<[T]> ⓘ

Converts a [T; N] into an Arc<[T]>.

The conversion moves the array into a newly allocated Arc.

§Example
let original: [i32; 3] = [1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
Source§

impl<T> FromArg for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

type This<'from_arg> = Arc<T>

The type to convert into. Read more
Source§

fn from_arg(arg: Arg<'_>) -> Result<<Arc<T> as FromArg>::This<'_>, ArgError>

Creates an item from an argument. Read more
1.37.0 · Source§

impl<T> FromIterator<T> for Arc<[T]>

Available on non-no_global_oom_handling only.
Source§

fn from_iter<I>(iter: I) -> Arc<[T]> ⓘ
where I: IntoIterator<Item = T>,

Takes each element in the Iterator and collects it into an Arc<[T]>.

§Performance characteristics
§The general case

In the general case, collecting into Arc<[T]> is done by first collecting into a Vec<T>. That is, when writing the following:

let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0).collect();

this behaves as if we wrote:

let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0)
    .collect::<Vec<_>>() // The first set of allocations happens here.
    .into(); // A second allocation for `Arc<[T]>` happens here.

This will allocate as many times as needed for constructing the Vec<T> and then it will allocate once for turning the Vec<T> into the Arc<[T]>.

§Iterators of known length

When your Iterator implements TrustedLen and is of an exact size, a single allocation will be made for the Arc<[T]>. For example:

let evens: Arc<[u8]> = (0..10).collect(); // Just a single allocation happens here.
Source§

impl<T> FromReflect for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Arc<T>>

Constructs a concrete instance of Self from a reflected value.
Source§

fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
Source§

impl<T> GetOwnership for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn ownership() -> Ownership

Returns the ownership of Self.
Source§

impl<T> GetTypeRegistration for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn get_type_registration() -> TypeRegistration

Returns the default TypeRegistration for this type.
Source§

fn register_type_dependencies(_registry: &mut TypeRegistry)

Registers other types needed by this type. Read more
Source§

impl<H> HasDisplayHandle for Arc<H>
where H: HasDisplayHandle + ?Sized,

Available on crate feature alloc only.
Source§

fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>

Get a handle to the display controller of the windowing system.
Source§

impl<H> HasWindowHandle for Arc<H>
where H: HasWindowHandle + ?Sized,

Available on crate feature alloc only.
Source§

fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>

Get a handle to the window.
1.0.0 · Source§

impl<T, A> Hash for Arc<T, A>
where T: Hash + ?Sized, A: Allocator,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> IntoReturn for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn into_return<'into_return>(self) -> Return<'into_return>
where Arc<T>: 'into_return,

Converts Self into a Return value.
Source§

impl<Sp> LocalSpawn for Arc<Sp>
where Sp: LocalSpawn + ?Sized,

Available on target_has_atomic=ptr only.
Source§

fn spawn_local_obj( &self, future: LocalFutureObj<'static, ()>, ) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
Source§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
Source§

impl<T> Log for Arc<T>
where T: Log + ?Sized,

Available on crate feature std only.
Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records. Read more
Source§

impl<'a, W> MakeWriter<'a> for Arc<W>
where &'a W: Write + 'a,

Source§

type Writer = &'a W

The concrete io::Write implementation returned by make_writer.
Source§

fn make_writer(&'a self) -> <Arc<W> as MakeWriter<'a>>::Writer ⓘ

Returns an instance of Writer. Read more
Source§

fn make_writer_for(&'a self, meta: &Metadata<'_>) -> Self::Writer

Returns a Writer for writing data from the span or event described by the provided Metadata. Read more
1.0.0 · Source§

impl<T, A> Ord for Arc<T, A>
where T: Ord + ?Sized, A: Allocator,

Source§

fn cmp(&self, other: &Arc<T, A>) -> Ordering

Comparison for two Arcs.

The two are compared by calling cmp() on their inner values.

§Examples
use std::sync::Arc;
use std::cmp::Ordering;

let five = Arc::new(5);

assert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
1.0.0 · Source§

impl<T, A> PartialEq for Arc<T, A>
where T: PartialEq + ?Sized, A: Allocator,

Source§

fn eq(&self, other: &Arc<T, A>) -> bool

Equality for two Arcs.

Two Arcs are equal if their inner values are equal, even if they are stored in different allocation.

If T also implements Eq (implying reflexivity of equality), two Arcs that point to the same allocation are always equal.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five == Arc::new(5));
Source§

fn ne(&self, other: &Arc<T, A>) -> bool

Inequality for two Arcs.

Two Arcs are not equal if their inner values are not equal.

If T also implements Eq (implying reflexivity of equality), two Arcs that point to the same value are always equal.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five != Arc::new(6));
1.0.0 · Source§

impl<T, A> PartialOrd for Arc<T, A>
where T: PartialOrd + ?Sized, A: Allocator,

Source§

fn partial_cmp(&self, other: &Arc<T, A>) -> Option<Ordering>

Partial comparison for two Arcs.

The two are compared by calling partial_cmp() on their inner values.

§Examples
use std::sync::Arc;
use std::cmp::Ordering;

let five = Arc::new(5);

assert_eq!(Some(Ordering::Less), five.partial_cmp(&Arc::new(6)));
Source§

fn lt(&self, other: &Arc<T, A>) -> bool

Less-than comparison for two Arcs.

The two are compared by calling < on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five < Arc::new(6));
Source§

fn le(&self, other: &Arc<T, A>) -> bool

‘Less than or equal to’ comparison for two Arcs.

The two are compared by calling <= on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five <= Arc::new(5));
Source§

fn gt(&self, other: &Arc<T, A>) -> bool

Greater-than comparison for two Arcs.

The two are compared by calling > on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five > Arc::new(4));
Source§

fn ge(&self, other: &Arc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Arcs.

The two are compared by calling >= on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five >= Arc::new(5));
Source§

impl<T> PartialReflect for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
Source§

fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>

Converts this reflected value into its dynamic representation based on its kind. Read more
Source§

fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>

Tries to apply a reflected value to this value. Read more
Source§

fn reflect_kind(&self) -> ReflectKind

Returns a zero-sized enumeration of “kinds” of type. Read more
Source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an immutable enumeration of “kinds” of type. Read more
Source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
Source§

fn reflect_owned(self: Box<Arc<T>>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
Source§

fn try_into_reflect( self: Box<Arc<T>>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>

Attempts to cast this type to a boxed, fully-reflected value.
Source§

fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>

Attempts to cast this type to a fully-reflected value.
Source§

fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>

Attempts to cast this type to a mutable, fully-reflected value.
Source§

fn into_partial_reflect(self: Box<Arc<T>>) -> Box<dyn PartialReflect>

Casts this type to a boxed, reflected value. Read more
Source§

fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)

Casts this type to a reflected value. Read more
Source§

fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)

Casts this type to a mutable, reflected value. Read more
Source§

fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>

Attempts to clone Self using reflection. Read more
Source§

fn apply(&mut self, value: &(dyn PartialReflect + 'static))

Applies a reflected value to this value. Read more
Source§

fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
where T: 'static, Self: Sized + TypePath,

For a type implementing PartialReflect, combines reflect_clone and take in a useful fashion, automatically constructing an appropriate ReflectCloneError if the downcast fails.
Source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
Source§

fn reflect_partial_eq( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<bool>

Returns a “partial equality” comparison result. Read more
Source§

fn reflect_partial_cmp( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<Ordering>

Returns a “partial comparison” result. Read more
Source§

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

Debug formatter for the value. Read more
Source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
Source§

impl<T, A> PinSafePointer for Arc<T, A>
where A: StaticAllocator, T: ?Sized,

1.0.0 · Source§

impl<T, A> Pointer for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

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

Formats the value using the given formatter. Read more
1.73.0 · Source§

impl<R> Read for Arc<R>
where R: Read + IoHandle + ?Sized, &'a R: for<'a> Read,

Available on target_has_atomic=ptr and non-no_rc and non-no_sync only.
Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

fn read_buf(&mut self, cursor: BorrowedCursor<'_, u8>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf_exact( &mut self, cursor: BorrowedCursor<'_, u8>, ) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self> ⓘ
where Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R> ⓘ
where R: Read, Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self> ⓘ
where Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
Source§

fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Error>
where Self: Sized,

🔬This is a nightly-only experimental API. (read_array)
Read and return a fixed array of bytes from this source. Read more
Source§

fn read_le<T>(&mut self) -> Result<T, Error>
where T: FromEndianBytes, Self: Sized,

🔬This is a nightly-only experimental API. (read_le)
Read and return a type (e.g. an integer) in little-endian order. Read more
Source§

fn read_be<T>(&mut self) -> Result<T, Error>
where T: FromEndianBytes, Self: Sized,

🔬This is a nightly-only experimental API. (read_le)
Read and return a type (e.g. an integer) in big-endian order. Read more
Source§

impl ReadHalf for Arc<Async<TcpStream>>

Source§

fn recvmsg<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<(usize, Vec<OwnedFd>), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<Async<TcpStream>>: 'async_trait,

Attempt to receive bytes from the socket. Read more
Source§

fn auth_mechanism(&self) -> AuthMechanism

The authentication mechanism to use for this socket on the target OS. Read more
Source§

fn receive_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, seq: u64, already_received_bytes: &'life1 mut Vec<u8>, already_received_fds: &'life2 mut Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<Message, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Receive a message on the socket. Read more
Source§

fn can_pass_unix_fd(&self) -> bool

Return whether passing file descriptors is supported. Read more
Source§

fn peer_credentials<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ConnectionCredentials, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The peer credentials.
Source§

impl ReadHalf for Arc<Async<UnixStream>>

Source§

fn can_pass_unix_fd(&self) -> bool

Supports passing file descriptors.

Source§

fn recvmsg<'life0, 'life1, 'async_trait>( &'life0 mut self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<(usize, Vec<OwnedFd>), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<Async<UnixStream>>: 'async_trait,

Attempt to receive bytes from the socket. Read more
Source§

fn peer_credentials<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ConnectionCredentials, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<Async<UnixStream>>: 'async_trait,

The peer credentials.
Source§

fn receive_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, seq: u64, already_received_bytes: &'life1 mut Vec<u8>, already_received_fds: &'life2 mut Vec<OwnedFd>, ) -> Pin<Box<dyn Future<Output = Result<Message, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Receive a message on the socket. Read more
Source§

fn auth_mechanism(&self) -> AuthMechanism

The authentication mechanism to use for this socket on the target OS. Read more
Source§

impl<T> Reflect for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn into_any(self: Box<Arc<T>>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the value as a &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the value as a &mut dyn Any. Read more
Source§

fn into_reflect(self: Box<Arc<T>>) -> Box<dyn Reflect>

Casts this type to a boxed, fully-reflected value.
Source§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a fully-reflected value.
Source§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable, fully-reflected value.
Source§

fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
Source§

impl<C> RequestConnection for Arc<C>

Source§

type Buf = <C as RequestConnection>::Buf

Type used as buffer to store raw replies or events before they are parsed.
Source§

fn send_request_with_reply<R>( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<Cookie<'_, Arc<C>, R>, ConnectionError>
where R: TryParse,

Send a request with a reply to the server. Read more
Source§

fn send_trait_request_with_reply<R>( &self, request: R, ) -> Result<Cookie<'_, Arc<C>, <R as ReplyRequest>::Reply>, ConnectionError>
where R: ReplyRequest,

Send a request with a reply to the server. Read more
Source§

fn send_request_with_reply_with_fds<R>( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<CookieWithFds<'_, Arc<C>, R>, ConnectionError>
where R: TryParseFd,

Send a request with a reply containing file descriptors to the server. Read more
Source§

fn send_trait_request_with_reply_with_fds<R>( &self, request: R, ) -> Result<CookieWithFds<'_, Arc<C>, <R as ReplyFDsRequest>::Reply>, ConnectionError>
where R: ReplyFDsRequest,

Send a request with a reply containing file descriptors to the server. Read more
Source§

fn send_request_without_reply( &self, bufs: &[IoSlice<'_>], fds: Vec<OwnedFd>, ) -> Result<VoidCookie<'_, Arc<C>>, ConnectionError>

Send a request without a reply to the server. Read more
Source§

fn send_trait_request_without_reply<R>( &self, request: R, ) -> Result<VoidCookie<'_, Arc<C>>, ConnectionError>
where R: VoidRequest,

Send a request without a reply to the server. Read more
Source§

fn discard_reply(&self, sequence: u64, kind: RequestKind, mode: DiscardMode)

A reply to an error should be discarded. Read more
Source§

fn prefetch_extension_information( &self, extension_name: &'static str, ) -> Result<(), ConnectionError>

Prefetches information about an extension. Read more
Source§

fn extension_information( &self, extension_name: &'static str, ) -> Result<Option<ExtensionInformation>, ConnectionError>

Get information about an extension. Read more
Source§

fn wait_for_reply_or_error( &self, sequence: u64, ) -> Result<<Arc<C> as RequestConnection>::Buf, ReplyError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply_or_raw_error( &self, sequence: u64, ) -> Result<ReplyOrError<<Arc<C> as RequestConnection>::Buf>, ConnectionError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply( &self, sequence: u64, ) -> Result<Option<<Arc<C> as RequestConnection>::Buf>, ConnectionError>

Wait for the reply to a request. Read more
Source§

fn wait_for_reply_with_fds( &self, sequence: u64, ) -> Result<(<Arc<C> as RequestConnection>::Buf, Vec<OwnedFd>), ReplyError>

Wait for the reply to a request that has FDs. Read more
Source§

fn wait_for_reply_with_fds_raw( &self, sequence: u64, ) -> Result<ReplyOrError<(<Arc<C> as RequestConnection>::Buf, Vec<OwnedFd>), <Arc<C> as RequestConnection>::Buf>, ConnectionError>

Wait for the reply to a request that has FDs. Read more
Source§

fn check_for_error(&self, sequence: u64) -> Result<(), ReplyError>

Check whether a request that does not have a reply caused an X11 error. Read more
Source§

fn check_for_raw_error( &self, sequence: u64, ) -> Result<Option<<Arc<C> as RequestConnection>::Buf>, ConnectionError>

Check whether a request that does not have a reply caused an X11 error. Read more
Source§

fn prefetch_maximum_request_bytes(&self)

Prefetches the maximum request length. Read more
Source§

fn maximum_request_bytes(&self) -> usize

The maximum number of bytes that the X11 server accepts in a request.
Source§

fn parse_error(&self, error: &[u8]) -> Result<X11Error, ParseError>

Parse a generic error.
Source§

fn parse_event(&self, event: &[u8]) -> Result<Event, ParseError>

Parse a generic event.
Source§

impl<T> ResourceType for Arc<T>
where T: ResourceType,

Source§

const TYPE: &'static str = T::TYPE

1.73.0 · Source§

impl<S> Seek for Arc<S>
where S: Seek + IoHandle + ?Sized, &'a S: for<'a> Seek,

Available on target_has_atomic=ptr and non-no_rc and non-no_sync only.
Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Seek to an offset, in bytes, in a stream. Read more
Source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
Source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
Source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more
1.0.0 · Source§

impl<T, A> Send for Arc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send + Sync,

Source§

impl<Request, S> Service<Request> for Arc<S>
where S: Service<Request> + ?Sized,

Source§

type Response = <S as Service<Request>>::Response

Responses given by the service.
Source§

type Error = <S as Service<Request>>::Error

Errors produced by the service. Read more
Source§

type Future = <S as Service<Request>>::Future

The future response value.
Source§

fn call(&self, req: Request) -> <Arc<S> as Service<Request>>::Future ⓘ

Process the request and return the response asynchronously. call takes &self instead of mut &self because: Read more
Source§

impl<T> ShaderSize for Arc<T>
where T: ShaderSize + ?Sized,

Source§

const SHADER_SIZE: NonZero<u64> = T::SHADER_SIZE

Represents WGSL Size (equivalent to ShaderType::min_size)
Source§

impl<T> ShaderType for Arc<T>
where T: ShaderType + ?Sized,

Source§

fn size(&self) -> NonZero<u64>

Returns the size of Self at runtime Read more
Source§

fn min_size() -> NonZero<u64>

Represents the minimum size of Self (equivalent to GPUBufferBindingLayout.minBindingSize) Read more
Source§

fn assert_uniform_compat()

Source§

impl<T, A> Share for Arc<T, A>
where A: AllocatorClone, T: ?Sized,

Source§

final fn share(&self) -> Self

🔬This is a nightly-only experimental API. (share_trait)
Creates another alias to the same underlying resource or shared state. Read more
Source§

impl<Sp> Spawn for Arc<Sp>
where Sp: Spawn + ?Sized,

Available on target_has_atomic=ptr only.
Source§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
Source§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
Source§

impl<T> StableDeref for Arc<T>
where T: ?Sized,

Available on target_has_atomic=ptr and crate feature alloc only.
Source§

impl<S> Subscriber for Arc<S>
where S: Subscriber + ?Sized,

Source§

fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest

Registers a new callsite with this subscriber, returning whether or not the subscriber is interested in being notified about the callsite. Read more
Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Returns true if a span or event with the specified metadata would be recorded. Read more
Source§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns the highest verbosity level that this Subscriber will enable, or None, if the subscriber does not implement level-based filtering or chooses not to implement this method. Read more
Source§

fn new_span(&self, span: &Attributes<'_>) -> Id

Visit the construction of a new span, returning a new span ID for the span being constructed. Read more
Source§

fn record(&self, span: &Id, values: &Record<'_>)

Record a set of values on a span. Read more
Source§

fn record_follows_from(&self, span: &Id, follows: &Id)

Adds an indication that span follows from the span with the id follows. Read more
Source§

fn event_enabled(&self, event: &Event<'_>) -> bool

Determine if an Event should be recorded. Read more
Source§

fn event(&self, event: &Event<'_>)

Records that an Event has occurred. Read more
Source§

fn enter(&self, span: &Id)

Records that a span has been entered. Read more
Source§

fn exit(&self, span: &Id)

Records that a span has been exited. Read more
Source§

fn clone_span(&self, id: &Id) -> Id

Notifies the subscriber that a span ID has been cloned. Read more
Source§

fn try_close(&self, id: Id) -> bool

Notifies the subscriber that a span ID has been dropped, and returns true if there are now 0 IDs that refer to that span. Read more
Source§

fn drop_span(&self, id: Id)

👎Deprecated since 0.1.2:

use Subscriber::try_close instead

This method is deprecated. Read more
Source§

fn current_span(&self) -> Current

Returns a type representing this subscriber’s view of the current span. Read more
Source§

unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()>

If self is the same type as the provided TypeId, returns an untyped *const pointer to that type. Otherwise, returns None. Read more
Source§

fn on_register_dispatch(&self, subscriber: &Dispatch)

Invoked when this subscriber becomes a Dispatch. Read more
1.0.0 · Source§

impl<T, A> Sync for Arc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send + Sync,

Source§

impl<T> ToTokens for Arc<T>
where T: ToTokens + ?Sized,

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
Source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
Source§

fn into_token_stream(self) -> TokenStream
where Self: Sized,

Convert self directly into a TokenStream object. Read more
1.43.0 · Source§

impl<T, A, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A>
where A: Allocator,

Source§

type Error = Arc<[T], A>

The type returned in the event of a conversion error.
Source§

fn try_from( boxed_slice: Arc<[T], A>, ) -> Result<Arc<[T; N], A>, <Arc<[T; N], A> as TryFrom<Arc<[T], A>>>::Error>

Performs the conversion.
Source§

impl<T> Type for Arc<T>
where T: Type + ?Sized,

Source§

const SIGNATURE: &'static Signature = T::SIGNATURE

The signature for the implementing type, in parsed format. Read more
Source§

impl<T> TypePath for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
Source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
Source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
Source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
Source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
Source§

impl<T> Typed for Arc<T>
where T: Send + Sync + TypePath + ?Sized, Arc<T>: Any + Send + Sync,

Source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
1.33.0 · Source§

impl<T, A> Unpin for Arc<T, A>
where A: Allocator, T: ?Sized,

1.9.0 · Source§

impl<T, A> UnwindSafe for Arc<T, A>

Source§

impl<T, A> UseCloned for Arc<T, A>
where A: AllocatorClone, T: ?Sized,

1.73.0 · Source§

impl<W> Write for Arc<W>
where W: Write + IoHandle + ?Sized, &'a W: for<'a> Write,

Available on target_has_atomic=ptr and non-no_rc and non-no_sync only.
Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Writes a buffer into this writer, returning how many bytes were written. Read more
Source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
Source§

fn flush(&mut self) -> Result<(), Error>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
Source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
Source§

impl WriteHalf for Arc<Async<TcpStream>>

Source§

fn sendmsg<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, buf: &'life1 [u8], fds: &'life2 [BorrowedFd<'life3>], ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Arc<Async<TcpStream>>: 'async_trait,

Attempt to send a message on the socket Read more
Source§

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<Async<TcpStream>>: 'async_trait,

Close the socket. Read more
Source§

fn peer_credentials<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ConnectionCredentials, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<Async<TcpStream>>: 'async_trait,

The peer credentials.
Source§

fn send_message<'life0, 'life1, 'async_trait>( &'life0 mut self, msg: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Send a message on the socket. Read more
Source§

fn can_pass_unix_fd(&self) -> bool

Whether passing file descriptors is supported. Read more
Source§

impl WriteHalf for Arc<Async<UnixStream>>

Source§

fn can_pass_unix_fd(&self) -> bool

Supports passing file descriptors.

Source§

fn sendmsg<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, buffer: &'life1 [u8], fds: &'life2 [BorrowedFd<'life3>], ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Arc<Async<UnixStream>>: 'async_trait,

Attempt to send a message on the socket Read more
Source§

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<Async<UnixStream>>: 'async_trait,

Close the socket. Read more
Source§

fn peer_credentials<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ConnectionCredentials, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<Async<UnixStream>>: 'async_trait,

The peer credentials.
Source§

fn send_message<'life0, 'life1, 'async_trait>( &'life0 mut self, msg: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Send a message on the socket. Read more
Source§

impl<T> WriteInto for Arc<T>
where T: WriteInto + ?Sized,

Source§

fn write_into<B>(&self, writer: &mut Writer<B>)
where B: BufferMut,

Source§

impl<T> Writeable for Arc<T>
where T: Writeable + ?Sized,

Source§

fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
where W: Write + ?Sized,

Writes a string to the given sink. Errors from the sink are bubbled up. The default implementation delegates to write_to_parts, and discards any Part annotations.
Source§

fn write_to_parts<W>(&self, sink: &mut W) -> Result<(), Error>
where W: PartsWrite + ?Sized,

Write bytes and Part annotations to the given sink. Errors from the sink are bubbled up. The default implementation delegates to write_to, and doesn’t produce any Part annotations.
Source§

fn writeable_length_hint(&self) -> LengthHint

Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more
Source§

fn writeable_borrow(&self) -> Option<&str>

Returns a &str that matches the output of write_to, if possible. Read more
Source§

fn write_to_string(&self) -> Cow<'_, str>

Available on crate feature alloc only.
Creates a new string with the data from this Writeable. Read more

Auto Trait Implementations§

§

impl<T, A> Freeze for Arc<T, A>
where NonNull<ArcInner<T>>: Freeze, PhantomData<ArcInner<T>>: Freeze, A: Freeze, T: ?Sized,

§

impl<T, A> RefUnwindSafe for Arc<T, A>
where NonNull<ArcInner<T>>: RefUnwindSafe, PhantomData<ArcInner<T>>: RefUnwindSafe, A: RefUnwindSafe, T: ?Sized,

§

impl<T, A> UnsafeUnpin for Arc<T, A>
where NonNull<ArcInner<T>>: UnsafeUnpin, PhantomData<ArcInner<T>>: UnsafeUnpin, A: UnsafeUnpin, T: ?Sized,

Blanket Implementations§

Source§

impl<T, C> AnimationCompatibleCurve<T> for C
where C: Curve<T> + Debug + Clone + Reflectable,

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
Source§

impl<A, T> AsBits<T> for A
where A: AsRef<[T]>, T: BitStore,

Source§

fn as_bits<O>(&self) -> &BitSlice<T, O> ⓘ
where O: BitOrder,

Views self as an immutable bit-slice region with the O ordering.
Source§

fn try_as_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view self as an immutable bit-slice region with the O ordering. Read more
Source§

impl<T> AsSource for T
where T: AsFd,

Source§

fn source(&self) -> BorrowedFd<'_>

Returns the borrowed file descriptor.
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

Source§

impl<P> BufferProvider for P

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheapCloneStr for T
where T: AsRef<str> + for<'a> From<&'a str> + From<String> + PartialEq + Eq + Clone + Default + Debug + 'static,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<C> ConnectionExt for C
where C: ConnectionExt + ?Sized,

Source§

fn change_property8<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u8], ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 8.
Source§

fn change_property16<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u16], ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 16.
Source§

fn change_property32<A, B>( &self, mode: PropMode, window: u32, property: A, type_: B, data: &[u32], ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Change a property on a window with format 32.
Source§

fn sync(&self) -> Result<(), ReplyError>

Synchronise with the X11 server. Read more
Source§

impl<C> ConnectionExt for C

Source§

fn create_window<'c, 'input>( &'c self, depth: u8, wid: u32, parent: u32, x: i16, y: i16, width: u16, height: u16, border_width: u16, class: WindowClass, visual: u32, value_list: &'input CreateWindowAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Creates a window. Read more
Source§

fn change_window_attributes<'c, 'input>( &'c self, window: u32, value_list: &'input ChangeWindowAttributesAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

change window attributes. Read more
Source§

fn get_window_attributes( &self, window: u32, ) -> Result<Cookie<'_, Self, GetWindowAttributesReply>, ConnectionError>

Gets window attributes. Read more
Source§

fn destroy_window( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a window. Read more
Source§

fn destroy_subwindows( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn change_save_set( &self, mode: SetMode, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Changes a client’s save set. Read more
Source§

fn reparent_window( &self, window: u32, parent: u32, x: i16, y: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Reparents a window. Read more
Source§

fn map_window( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Makes a window visible. Read more
Source§

fn map_subwindows( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn unmap_window( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Makes a window invisible. Read more
Source§

fn unmap_subwindows( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn configure_window<'c, 'input>( &'c self, window: u32, value_list: &'input ConfigureWindowAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Configures window attributes. Read more
Source§

fn circulate_window( &self, direction: Circulate, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Change window stacking order. Read more
Source§

fn get_geometry( &self, drawable: u32, ) -> Result<Cookie<'_, Self, GetGeometryReply>, ConnectionError>

Get current window geometry. Read more
Source§

fn query_tree( &self, window: u32, ) -> Result<Cookie<'_, Self, QueryTreeReply>, ConnectionError>

query the window tree. Read more
Source§

fn intern_atom<'c, 'input>( &'c self, only_if_exists: bool, name: &'input [u8], ) -> Result<Cookie<'c, Self, InternAtomReply>, ConnectionError>

Get atom identifier by name. Read more
Source§

fn get_atom_name( &self, atom: u32, ) -> Result<Cookie<'_, Self, GetAtomNameReply>, ConnectionError>

Source§

fn change_property<'c, 'input, A, B>( &'c self, mode: PropMode, window: u32, property: A, type_: B, format: u8, data_len: u32, data: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Changes a window property. Read more
Source§

fn delete_property( &self, window: u32, property: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn get_property<A, B>( &self, delete: bool, window: u32, property: A, type_: B, long_offset: u32, long_length: u32, ) -> Result<Cookie<'_, Self, GetPropertyReply>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Gets a window property. Read more
Source§

fn list_properties( &self, window: u32, ) -> Result<Cookie<'_, Self, ListPropertiesReply>, ConnectionError>

Source§

fn set_selection_owner<A, B>( &self, owner: A, selection: u32, time: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Sets the owner of a selection. Read more
Source§

fn get_selection_owner( &self, selection: u32, ) -> Result<Cookie<'_, Self, GetSelectionOwnerReply>, ConnectionError>

Gets the owner of a selection. Read more
Source§

fn convert_selection<A, B>( &self, requestor: u32, selection: u32, target: u32, property: A, time: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Source§

fn send_event<A, B>( &self, propagate: bool, destination: A, event_mask: EventMask, event: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<[u8; 32]>,

send an event. Read more
Source§

fn grab_pointer<A, B, C>( &self, owner_events: bool, grab_window: u32, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, time: C, ) -> Result<Cookie<'_, Self, GrabPointerReply>, ConnectionError>
where A: Into<u32>, B: Into<u32>, C: Into<u32>,

Grab the pointer. Read more
Source§

fn ungrab_pointer<A>( &self, time: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

release the pointer. Read more
Source§

fn grab_button<A, B>( &self, owner_events: bool, grab_window: u32, event_mask: EventMask, pointer_mode: GrabMode, keyboard_mode: GrabMode, confine_to: A, cursor: B, button: ButtonIndex, modifiers: ModMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Grab pointer button(s). Read more
Source§

fn ungrab_button( &self, button: ButtonIndex, grab_window: u32, modifiers: ModMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn change_active_pointer_grab<A, B>( &self, cursor: A, time: B, event_mask: EventMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Source§

fn grab_keyboard<A>( &self, owner_events: bool, grab_window: u32, time: A, pointer_mode: GrabMode, keyboard_mode: GrabMode, ) -> Result<Cookie<'_, Self, GrabKeyboardReply>, ConnectionError>
where A: Into<u32>,

Grab the keyboard. Read more
Source§

fn ungrab_keyboard<A>( &self, time: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn grab_key<A>( &self, owner_events: bool, grab_window: u32, modifiers: ModMask, key: A, pointer_mode: GrabMode, keyboard_mode: GrabMode, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u8>,

Grab keyboard key(s). Read more
Source§

fn ungrab_key<A>( &self, key: A, grab_window: u32, modifiers: ModMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u8>,

release a key combination. Read more
Source§

fn allow_events<A>( &self, mode: Allow, time: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

release queued events. Read more
Source§

fn grab_server(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn ungrab_server(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn query_pointer( &self, window: u32, ) -> Result<Cookie<'_, Self, QueryPointerReply>, ConnectionError>

get pointer coordinates. Read more
Source§

fn get_motion_events<A, B>( &self, window: u32, start: A, stop: B, ) -> Result<Cookie<'_, Self, GetMotionEventsReply>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Source§

fn translate_coordinates( &self, src_window: u32, dst_window: u32, src_x: i16, src_y: i16, ) -> Result<Cookie<'_, Self, TranslateCoordinatesReply>, ConnectionError>

Source§

fn warp_pointer<A, B>( &self, src_window: A, dst_window: B, src_x: i16, src_y: i16, src_width: u16, src_height: u16, dst_x: i16, dst_y: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

move mouse pointer. Read more
Source§

fn set_input_focus<A, B>( &self, revert_to: InputFocus, focus: A, time: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Sets input focus. Read more
Source§

fn get_input_focus( &self, ) -> Result<Cookie<'_, Self, GetInputFocusReply>, ConnectionError>

Source§

fn query_keymap( &self, ) -> Result<Cookie<'_, Self, QueryKeymapReply>, ConnectionError>

Source§

fn open_font<'c, 'input>( &'c self, fid: u32, name: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

opens a font. Read more
Source§

fn close_font(&self, font: u32) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn query_font( &self, font: u32, ) -> Result<Cookie<'_, Self, QueryFontReply>, ConnectionError>

query font metrics. Read more
Source§

fn query_text_extents<'c, 'input>( &'c self, font: u32, string: &'input [Char2b], ) -> Result<Cookie<'c, Self, QueryTextExtentsReply>, ConnectionError>

get text extents. Read more
Source§

fn list_fonts<'c, 'input>( &'c self, max_names: u16, pattern: &'input [u8], ) -> Result<Cookie<'c, Self, ListFontsReply>, ConnectionError>

get matching font names. Read more
Source§

fn list_fonts_with_info<'c, 'input>( &'c self, max_names: u16, pattern: &'input [u8], ) -> Result<ListFontsWithInfoCookie<'c, Self>, ConnectionError>

get matching font names and information. Read more
Source§

fn set_font_path<'c, 'input>( &'c self, font: &'input [Str], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn get_font_path( &self, ) -> Result<Cookie<'_, Self, GetFontPathReply>, ConnectionError>

Source§

fn create_pixmap( &self, depth: u8, pid: u32, drawable: u32, width: u16, height: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Creates a pixmap. Read more
Source§

fn free_pixmap( &self, pixmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a pixmap. Read more
Source§

fn create_gc<'c, 'input>( &'c self, cid: u32, drawable: u32, value_list: &'input CreateGCAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Creates a graphics context. Read more
Source§

fn change_gc<'c, 'input>( &'c self, gc: u32, value_list: &'input ChangeGCAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

change graphics context components. Read more
Source§

fn copy_gc( &self, src_gc: u32, dst_gc: u32, value_mask: GC, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn set_dashes<'c, 'input>( &'c self, gc: u32, dash_offset: u16, dashes: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn set_clip_rectangles<'c, 'input>( &'c self, ordering: ClipOrdering, gc: u32, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn free_gc(&self, gc: u32) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys a graphics context. Read more
Source§

fn clear_area( &self, exposures: bool, window: u32, x: i16, y: i16, width: u16, height: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn copy_area( &self, src_drawable: u32, dst_drawable: u32, gc: u32, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

copy areas. Read more
Source§

fn copy_plane( &self, src_drawable: u32, dst_drawable: u32, gc: u32, src_x: i16, src_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, bit_plane: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn poly_point<'c, 'input>( &'c self, coordinate_mode: CoordMode, drawable: u32, gc: u32, points: &'input [Point], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn poly_line<'c, 'input>( &'c self, coordinate_mode: CoordMode, drawable: u32, gc: u32, points: &'input [Point], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

draw lines. Read more
Source§

fn poly_segment<'c, 'input>( &'c self, drawable: u32, gc: u32, segments: &'input [Segment], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

draw lines. Read more
Source§

fn poly_rectangle<'c, 'input>( &'c self, drawable: u32, gc: u32, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn poly_arc<'c, 'input>( &'c self, drawable: u32, gc: u32, arcs: &'input [Arc], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn fill_poly<'c, 'input>( &'c self, drawable: u32, gc: u32, shape: PolyShape, coordinate_mode: CoordMode, points: &'input [Point], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn poly_fill_rectangle<'c, 'input>( &'c self, drawable: u32, gc: u32, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Fills rectangles. Read more
Source§

fn poly_fill_arc<'c, 'input>( &'c self, drawable: u32, gc: u32, arcs: &'input [Arc], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn put_image<'c, 'input>( &'c self, format: ImageFormat, drawable: u32, gc: u32, width: u16, height: u16, dst_x: i16, dst_y: i16, left_pad: u8, depth: u8, data: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn get_image( &self, format: ImageFormat, drawable: u32, x: i16, y: i16, width: u16, height: u16, plane_mask: u32, ) -> Result<Cookie<'_, Self, GetImageReply>, ConnectionError>

Source§

fn poly_text8<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, items: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn poly_text16<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, items: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn image_text8<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, string: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Draws text. Read more
Source§

fn image_text16<'c, 'input>( &'c self, drawable: u32, gc: u32, x: i16, y: i16, string: &'input [Char2b], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Draws text. Read more
Source§

fn create_colormap( &self, alloc: ColormapAlloc, mid: u32, window: u32, visual: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn free_colormap( &self, cmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn copy_colormap_and_free( &self, mid: u32, src_cmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn install_colormap( &self, cmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn uninstall_colormap( &self, cmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn list_installed_colormaps( &self, window: u32, ) -> Result<Cookie<'_, Self, ListInstalledColormapsReply>, ConnectionError>

Source§

fn alloc_color( &self, cmap: u32, red: u16, green: u16, blue: u16, ) -> Result<Cookie<'_, Self, AllocColorReply>, ConnectionError>

Allocate a color. Read more
Source§

fn alloc_named_color<'c, 'input>( &'c self, cmap: u32, name: &'input [u8], ) -> Result<Cookie<'c, Self, AllocNamedColorReply>, ConnectionError>

Source§

fn alloc_color_cells( &self, contiguous: bool, cmap: u32, colors: u16, planes: u16, ) -> Result<Cookie<'_, Self, AllocColorCellsReply>, ConnectionError>

Source§

fn alloc_color_planes( &self, contiguous: bool, cmap: u32, colors: u16, reds: u16, greens: u16, blues: u16, ) -> Result<Cookie<'_, Self, AllocColorPlanesReply>, ConnectionError>

Source§

fn free_colors<'c, 'input>( &'c self, cmap: u32, plane_mask: u32, pixels: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn store_colors<'c, 'input>( &'c self, cmap: u32, items: &'input [Coloritem], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn store_named_color<'c, 'input>( &'c self, flags: ColorFlag, cmap: u32, pixel: u32, name: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn query_colors<'c, 'input>( &'c self, cmap: u32, pixels: &'input [u32], ) -> Result<Cookie<'c, Self, QueryColorsReply>, ConnectionError>

Source§

fn lookup_color<'c, 'input>( &'c self, cmap: u32, name: &'input [u8], ) -> Result<Cookie<'c, Self, LookupColorReply>, ConnectionError>

Source§

fn create_cursor<A>( &self, cid: u32, source: u32, mask: A, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, x: u16, y: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn create_glyph_cursor<A>( &self, cid: u32, source_font: u32, mask_font: A, source_char: u16, mask_char: u16, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

create cursor. Read more
Source§

fn free_cursor( &self, cursor: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Deletes a cursor. Read more
Source§

fn recolor_cursor( &self, cursor: u32, fore_red: u16, fore_green: u16, fore_blue: u16, back_red: u16, back_green: u16, back_blue: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn query_best_size( &self, class: QueryShapeOf, drawable: u32, width: u16, height: u16, ) -> Result<Cookie<'_, Self, QueryBestSizeReply>, ConnectionError>

Source§

fn query_extension<'c, 'input>( &'c self, name: &'input [u8], ) -> Result<Cookie<'c, Self, QueryExtensionReply>, ConnectionError>

check if extension is present. Read more
Source§

fn list_extensions( &self, ) -> Result<Cookie<'_, Self, ListExtensionsReply>, ConnectionError>

Source§

fn change_keyboard_mapping<'c, 'input>( &'c self, keycode_count: u8, first_keycode: u8, keysyms_per_keycode: u8, keysyms: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn get_keyboard_mapping( &self, first_keycode: u8, count: u8, ) -> Result<Cookie<'_, Self, GetKeyboardMappingReply>, ConnectionError>

Source§

fn change_keyboard_control<'c, 'input>( &'c self, value_list: &'input ChangeKeyboardControlAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn get_keyboard_control( &self, ) -> Result<Cookie<'_, Self, GetKeyboardControlReply>, ConnectionError>

Source§

fn bell(&self, percent: i8) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn change_pointer_control( &self, acceleration_numerator: i16, acceleration_denominator: i16, threshold: i16, do_acceleration: bool, do_threshold: bool, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn get_pointer_control( &self, ) -> Result<Cookie<'_, Self, GetPointerControlReply>, ConnectionError>

Source§

fn set_screen_saver( &self, timeout: i16, interval: i16, prefer_blanking: Blanking, allow_exposures: Exposures, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn get_screen_saver( &self, ) -> Result<Cookie<'_, Self, GetScreenSaverReply>, ConnectionError>

Source§

fn change_hosts<'c, 'input>( &'c self, mode: HostMode, family: Family, address: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn list_hosts( &self, ) -> Result<Cookie<'_, Self, ListHostsReply>, ConnectionError>

Source§

fn set_access_control( &self, mode: AccessControl, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn set_close_down_mode( &self, mode: CloseDown, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn kill_client<A>( &self, resource: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

kills a client. Read more
Source§

fn rotate_properties<'c, 'input>( &'c self, window: u32, delta: i16, atoms: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn force_screen_saver( &self, mode: ScreenSaver, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn set_pointer_mapping<'c, 'input>( &'c self, map: &'input [u8], ) -> Result<Cookie<'c, Self, SetPointerMappingReply>, ConnectionError>

Source§

fn get_pointer_mapping( &self, ) -> Result<Cookie<'_, Self, GetPointerMappingReply>, ConnectionError>

Source§

fn set_modifier_mapping<'c, 'input>( &'c self, keycodes: &'input [u8], ) -> Result<Cookie<'c, Self, SetModifierMappingReply>, ConnectionError>

Source§

fn get_modifier_mapping( &self, ) -> Result<Cookie<'_, Self, GetModifierMappingReply>, ConnectionError>

Source§

fn no_operation(&self) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn bigreq_enable( &self, ) -> Result<Cookie<'_, Self, EnableReply>, ConnectionError>

Enable the BIG-REQUESTS extension. Read more
Source§

impl<C> ConnectionExt for C

Source§

fn ge_query_version( &self, client_major_version: u16, client_minor_version: u16, ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn randr_query_version( &self, major_version: u32, minor_version: u32, ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Source§

fn randr_set_screen_config( &self, window: u32, timestamp: u32, config_timestamp: u32, size_id: u16, rotation: Rotation, rate: u16, ) -> Result<Cookie<'_, Self, SetScreenConfigReply>, ConnectionError>

Source§

fn randr_select_input( &self, window: u32, enable: NotifyMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_screen_info( &self, window: u32, ) -> Result<Cookie<'_, Self, GetScreenInfoReply>, ConnectionError>

Source§

fn randr_get_screen_size_range( &self, window: u32, ) -> Result<Cookie<'_, Self, GetScreenSizeRangeReply>, ConnectionError>

Source§

fn randr_set_screen_size( &self, window: u32, width: u16, height: u16, mm_width: u32, mm_height: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_screen_resources( &self, window: u32, ) -> Result<Cookie<'_, Self, GetScreenResourcesReply>, ConnectionError>

Source§

fn randr_get_output_info( &self, output: u32, config_timestamp: u32, ) -> Result<Cookie<'_, Self, GetOutputInfoReply>, ConnectionError>

Source§

fn randr_list_output_properties( &self, output: u32, ) -> Result<Cookie<'_, Self, ListOutputPropertiesReply>, ConnectionError>

Source§

fn randr_query_output_property( &self, output: u32, property: u32, ) -> Result<Cookie<'_, Self, QueryOutputPropertyReply>, ConnectionError>

Source§

fn randr_configure_output_property<'c, 'input>( &'c self, output: u32, property: u32, pending: bool, range: bool, values: &'input [i32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_change_output_property<'c, 'input>( &'c self, output: u32, property: u32, type_: u32, format: u8, mode: PropMode, num_units: u32, data: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_delete_output_property( &self, output: u32, property: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_output_property<A>( &self, output: u32, property: u32, type_: A, long_offset: u32, long_length: u32, delete: bool, pending: bool, ) -> Result<Cookie<'_, Self, GetOutputPropertyReply>, ConnectionError>
where A: Into<u32>,

Source§

fn randr_create_mode<'c, 'input>( &'c self, window: u32, mode_info: ModeInfo, name: &'input [u8], ) -> Result<Cookie<'c, Self, CreateModeReply>, ConnectionError>

Source§

fn randr_destroy_mode( &self, mode: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_add_output_mode( &self, output: u32, mode: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_delete_output_mode( &self, output: u32, mode: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_crtc_info( &self, crtc: u32, config_timestamp: u32, ) -> Result<Cookie<'_, Self, GetCrtcInfoReply>, ConnectionError>

Source§

fn randr_set_crtc_config<'c, 'input>( &'c self, crtc: u32, timestamp: u32, config_timestamp: u32, x: i16, y: i16, mode: u32, rotation: Rotation, outputs: &'input [u32], ) -> Result<Cookie<'c, Self, SetCrtcConfigReply>, ConnectionError>

Source§

fn randr_get_crtc_gamma_size( &self, crtc: u32, ) -> Result<Cookie<'_, Self, GetCrtcGammaSizeReply>, ConnectionError>

Source§

fn randr_get_crtc_gamma( &self, crtc: u32, ) -> Result<Cookie<'_, Self, GetCrtcGammaReply>, ConnectionError>

Source§

fn randr_set_crtc_gamma<'c, 'input>( &'c self, crtc: u32, red: &'input [u16], green: &'input [u16], blue: &'input [u16], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_get_screen_resources_current( &self, window: u32, ) -> Result<Cookie<'_, Self, GetScreenResourcesCurrentReply>, ConnectionError>

Source§

fn randr_set_crtc_transform<'c, 'input>( &'c self, crtc: u32, transform: Transform, filter_name: &'input [u8], filter_params: &'input [i32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_get_crtc_transform( &self, crtc: u32, ) -> Result<Cookie<'_, Self, GetCrtcTransformReply>, ConnectionError>

Source§

fn randr_get_panning( &self, crtc: u32, ) -> Result<Cookie<'_, Self, GetPanningReply>, ConnectionError>

Source§

fn randr_set_panning( &self, crtc: u32, timestamp: u32, left: u16, top: u16, width: u16, height: u16, track_left: u16, track_top: u16, track_width: u16, track_height: u16, border_left: i16, border_top: i16, border_right: i16, border_bottom: i16, ) -> Result<Cookie<'_, Self, SetPanningReply>, ConnectionError>

Source§

fn randr_set_output_primary( &self, window: u32, output: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_output_primary( &self, window: u32, ) -> Result<Cookie<'_, Self, GetOutputPrimaryReply>, ConnectionError>

Source§

fn randr_get_providers( &self, window: u32, ) -> Result<Cookie<'_, Self, GetProvidersReply>, ConnectionError>

Source§

fn randr_get_provider_info( &self, provider: u32, config_timestamp: u32, ) -> Result<Cookie<'_, Self, GetProviderInfoReply>, ConnectionError>

Source§

fn randr_set_provider_offload_sink( &self, provider: u32, sink_provider: u32, config_timestamp: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_set_provider_output_source( &self, provider: u32, source_provider: u32, config_timestamp: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_list_provider_properties( &self, provider: u32, ) -> Result<Cookie<'_, Self, ListProviderPropertiesReply>, ConnectionError>

Source§

fn randr_query_provider_property( &self, provider: u32, property: u32, ) -> Result<Cookie<'_, Self, QueryProviderPropertyReply>, ConnectionError>

Source§

fn randr_configure_provider_property<'c, 'input>( &'c self, provider: u32, property: u32, pending: bool, range: bool, values: &'input [i32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_change_provider_property<'c, 'input>( &'c self, provider: u32, property: u32, type_: u32, format: u8, mode: u8, num_items: u32, data: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn randr_delete_provider_property( &self, provider: u32, property: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_get_provider_property( &self, provider: u32, property: u32, type_: u32, long_offset: u32, long_length: u32, delete: bool, pending: bool, ) -> Result<Cookie<'_, Self, GetProviderPropertyReply>, ConnectionError>

Source§

fn randr_get_monitors( &self, window: u32, get_active: bool, ) -> Result<Cookie<'_, Self, GetMonitorsReply>, ConnectionError>

Source§

fn randr_set_monitor( &self, window: u32, monitorinfo: MonitorInfo, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_delete_monitor( &self, window: u32, name: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn randr_create_lease<'c, 'input>( &'c self, window: u32, lid: u32, crtcs: &'input [u32], outputs: &'input [u32], ) -> Result<CookieWithFds<'c, Self, CreateLeaseReply>, ConnectionError>

Source§

fn randr_free_lease( &self, lid: u32, terminate: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn render_query_version( &self, client_major_version: u32, client_minor_version: u32, ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Source§

fn render_query_pict_formats( &self, ) -> Result<Cookie<'_, Self, QueryPictFormatsReply>, ConnectionError>

Source§

fn render_query_pict_index_values( &self, format: u32, ) -> Result<Cookie<'_, Self, QueryPictIndexValuesReply>, ConnectionError>

Source§

fn render_create_picture<'c, 'input>( &'c self, pid: u32, drawable: u32, format: u32, value_list: &'input CreatePictureAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_change_picture<'c, 'input>( &'c self, picture: u32, value_list: &'input ChangePictureAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_set_picture_clip_rectangles<'c, 'input>( &'c self, picture: u32, clip_x_origin: i16, clip_y_origin: i16, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_free_picture( &self, picture: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_composite<A>( &self, op: PictOp, src: u32, mask: A, dst: u32, src_x: i16, src_y: i16, mask_x: i16, mask_y: i16, dst_x: i16, dst_y: i16, width: u16, height: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn render_trapezoids<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, traps: &'input [Trapezoid], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_triangles<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, triangles: &'input [Triangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_tri_strip<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, points: &'input [Pointfix], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_tri_fan<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, src_x: i16, src_y: i16, points: &'input [Pointfix], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_glyph_set( &self, gsid: u32, format: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_reference_glyph_set( &self, gsid: u32, existing: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_free_glyph_set( &self, glyphset: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_add_glyphs<'c, 'input>( &'c self, glyphset: u32, glyphids: &'input [u32], glyphs: &'input [Glyphinfo], data: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_free_glyphs<'c, 'input>( &'c self, glyphset: u32, glyphs: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_composite_glyphs8<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_composite_glyphs16<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_composite_glyphs32<'c, 'input>( &'c self, op: PictOp, src: u32, dst: u32, mask_format: u32, glyphset: u32, src_x: i16, src_y: i16, glyphcmds: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_fill_rectangles<'c, 'input>( &'c self, op: PictOp, dst: u32, color: Color, rects: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_cursor( &self, cid: u32, source: u32, x: u16, y: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_set_picture_transform( &self, picture: u32, transform: Transform, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_query_filters( &self, drawable: u32, ) -> Result<Cookie<'_, Self, QueryFiltersReply>, ConnectionError>

Source§

fn render_set_picture_filter<'c, 'input>( &'c self, picture: u32, filter: &'input [u8], values: &'input [i32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_anim_cursor<'c, 'input>( &'c self, cid: u32, cursors: &'input [Animcursorelt], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_add_traps<'c, 'input>( &'c self, picture: u32, x_off: i16, y_off: i16, traps: &'input [Trap], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_solid_fill( &self, picture: u32, color: Color, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn render_create_linear_gradient<'c, 'input>( &'c self, picture: u32, p1: Pointfix, p2: Pointfix, stops: &'input [i32], colors: &'input [Color], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_radial_gradient<'c, 'input>( &'c self, picture: u32, inner: Pointfix, outer: Pointfix, inner_radius: i32, outer_radius: i32, stops: &'input [i32], colors: &'input [Color], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn render_create_conical_gradient<'c, 'input>( &'c self, picture: u32, center: Pointfix, angle: i32, stops: &'input [i32], colors: &'input [Color], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn shape_query_version( &self, ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Source§

fn shape_rectangles<'c, 'input>( &'c self, operation: SO, destination_kind: SK, ordering: ClipOrdering, destination_window: u32, x_offset: i16, y_offset: i16, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn shape_mask<A>( &self, operation: SO, destination_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16, source_bitmap: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn shape_combine( &self, operation: SO, destination_kind: SK, source_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16, source_window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn shape_offset( &self, destination_kind: SK, destination_window: u32, x_offset: i16, y_offset: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn shape_query_extents( &self, destination_window: u32, ) -> Result<Cookie<'_, Self, QueryExtentsReply>, ConnectionError>

Source§

fn shape_select_input( &self, destination_window: u32, enable: bool, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn shape_input_selected( &self, destination_window: u32, ) -> Result<Cookie<'_, Self, InputSelectedReply>, ConnectionError>

Source§

fn shape_get_rectangles( &self, window: u32, source_kind: SK, ) -> Result<Cookie<'_, Self, GetRectanglesReply>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn xc_misc_get_version( &self, client_major_version: u16, client_minor_version: u16, ) -> Result<Cookie<'_, Self, GetVersionReply>, ConnectionError>

Source§

fn xc_misc_get_xid_range( &self, ) -> Result<Cookie<'_, Self, GetXIDRangeReply>, ConnectionError>

Source§

fn xc_misc_get_xid_list( &self, count: u32, ) -> Result<Cookie<'_, Self, GetXIDListReply>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn xfixes_query_version( &self, client_major_version: u32, client_minor_version: u32, ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Source§

fn xfixes_change_save_set( &self, mode: SaveSetMode, target: SaveSetTarget, map: SaveSetMapping, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_select_selection_input( &self, window: u32, selection: u32, event_mask: SelectionEventMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_select_cursor_input( &self, window: u32, event_mask: CursorNotifyMask, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_get_cursor_image( &self, ) -> Result<Cookie<'_, Self, GetCursorImageReply>, ConnectionError>

Source§

fn xfixes_create_region<'c, 'input>( &'c self, region: u32, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xfixes_create_region_from_bitmap( &self, region: u32, bitmap: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_create_region_from_window( &self, region: u32, window: u32, kind: SK, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_create_region_from_gc( &self, region: u32, gc: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_create_region_from_picture( &self, region: u32, picture: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_destroy_region( &self, region: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_set_region<'c, 'input>( &'c self, region: u32, rectangles: &'input [Rectangle], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xfixes_copy_region( &self, source: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_union_region( &self, source1: u32, source2: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_intersect_region( &self, source1: u32, source2: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_subtract_region( &self, source1: u32, source2: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_invert_region( &self, source: u32, bounds: Rectangle, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_translate_region( &self, region: u32, dx: i16, dy: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_region_extents( &self, source: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_fetch_region( &self, region: u32, ) -> Result<Cookie<'_, Self, FetchRegionReply>, ConnectionError>

Source§

fn xfixes_set_gc_clip_region<A>( &self, gc: u32, region: A, x_origin: i16, y_origin: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn xfixes_set_window_shape_region<A>( &self, dest: u32, dest_kind: SK, x_offset: i16, y_offset: i16, region: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn xfixes_set_picture_clip_region<A>( &self, picture: u32, region: A, x_origin: i16, y_origin: i16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn xfixes_set_cursor_name<'c, 'input>( &'c self, cursor: u32, name: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xfixes_get_cursor_name( &self, cursor: u32, ) -> Result<Cookie<'_, Self, GetCursorNameReply>, ConnectionError>

Source§

fn xfixes_get_cursor_image_and_name( &self, ) -> Result<Cookie<'_, Self, GetCursorImageAndNameReply>, ConnectionError>

Source§

fn xfixes_change_cursor( &self, source: u32, destination: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_change_cursor_by_name<'c, 'input>( &'c self, src: u32, name: &'input [u8], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xfixes_expand_region( &self, source: u32, destination: u32, left: u16, right: u16, top: u16, bottom: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_hide_cursor( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_show_cursor( &self, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_create_pointer_barrier<'c, 'input>( &'c self, barrier: u32, window: u32, x1: u16, y1: u16, x2: u16, y2: u16, directions: BarrierDirections, devices: &'input [u16], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xfixes_delete_pointer_barrier( &self, barrier: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xfixes_set_client_disconnect_mode( &self, disconnect_mode: ClientDisconnectFlags, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Sets the disconnect mode for the client.. Read more
Source§

fn xfixes_get_client_disconnect_mode( &self, ) -> Result<Cookie<'_, Self, GetClientDisconnectModeReply>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn xinput_get_extension_version<'c, 'input>( &'c self, name: &'input [u8], ) -> Result<Cookie<'c, Self, GetExtensionVersionReply>, ConnectionError>

Source§

fn xinput_list_input_devices( &self, ) -> Result<Cookie<'_, Self, ListInputDevicesReply>, ConnectionError>

Source§

fn xinput_open_device( &self, device_id: u8, ) -> Result<Cookie<'_, Self, OpenDeviceReply>, ConnectionError>

Source§

fn xinput_close_device( &self, device_id: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xinput_set_device_mode( &self, device_id: u8, mode: ValuatorMode, ) -> Result<Cookie<'_, Self, SetDeviceModeReply>, ConnectionError>

Source§

fn xinput_select_extension_event<'c, 'input>( &'c self, window: u32, classes: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_get_selected_extension_events( &self, window: u32, ) -> Result<Cookie<'_, Self, GetSelectedExtensionEventsReply>, ConnectionError>

Source§

fn xinput_change_device_dont_propagate_list<'c, 'input>( &'c self, window: u32, mode: PropagateMode, classes: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_get_device_dont_propagate_list( &self, window: u32, ) -> Result<Cookie<'_, Self, GetDeviceDontPropagateListReply>, ConnectionError>

Source§

fn xinput_get_device_motion_events<A>( &self, start: u32, stop: A, device_id: u8, ) -> Result<Cookie<'_, Self, GetDeviceMotionEventsReply>, ConnectionError>
where A: Into<u32>,

Source§

fn xinput_change_keyboard_device( &self, device_id: u8, ) -> Result<Cookie<'_, Self, ChangeKeyboardDeviceReply>, ConnectionError>

Source§

fn xinput_change_pointer_device( &self, x_axis: u8, y_axis: u8, device_id: u8, ) -> Result<Cookie<'_, Self, ChangePointerDeviceReply>, ConnectionError>

Source§

fn xinput_grab_device<'c, 'input, A>( &'c self, grab_window: u32, time: A, this_device_mode: GrabMode, other_device_mode: GrabMode, owner_events: bool, device_id: u8, classes: &'input [u32], ) -> Result<Cookie<'c, Self, GrabDeviceReply>, ConnectionError>
where A: Into<u32>,

Source§

fn xinput_ungrab_device<A>( &self, time: A, device_id: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn xinput_grab_device_key<'c, 'input, A, B>( &'c self, grab_window: u32, modifiers: ModMask, modifier_device: A, grabbed_device: u8, key: B, this_device_mode: GrabMode, other_device_mode: GrabMode, owner_events: bool, classes: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>
where A: Into<u8>, B: Into<u8>,

Source§

fn xinput_ungrab_device_key<A, B>( &self, grab_window: u32, modifiers: ModMask, modifier_device: A, key: B, grabbed_device: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u8>, B: Into<u8>,

Source§

fn xinput_grab_device_button<'c, 'input, A, B>( &'c self, grab_window: u32, grabbed_device: u8, modifier_device: A, modifiers: ModMask, this_device_mode: GrabMode, other_device_mode: GrabMode, button: B, owner_events: bool, classes: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>
where A: Into<u8>, B: Into<u8>,

Source§

fn xinput_ungrab_device_button<A, B>( &self, grab_window: u32, modifiers: ModMask, modifier_device: A, button: B, grabbed_device: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u8>, B: Into<u8>,

Source§

fn xinput_allow_device_events<A>( &self, time: A, mode: DeviceInputMode, device_id: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>,

Source§

fn xinput_get_device_focus( &self, device_id: u8, ) -> Result<Cookie<'_, Self, GetDeviceFocusReply>, ConnectionError>

Source§

fn xinput_set_device_focus<A, B>( &self, focus: A, time: B, revert_to: InputFocus, device_id: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u32>,

Source§

fn xinput_get_feedback_control( &self, device_id: u8, ) -> Result<Cookie<'_, Self, GetFeedbackControlReply>, ConnectionError>

Source§

fn xinput_change_feedback_control( &self, mask: ChangeFeedbackControlMask, device_id: u8, feedback_id: u8, feedback: FeedbackCtl, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xinput_get_device_key_mapping( &self, device_id: u8, first_keycode: u8, count: u8, ) -> Result<Cookie<'_, Self, GetDeviceKeyMappingReply>, ConnectionError>

Source§

fn xinput_change_device_key_mapping<'c, 'input>( &'c self, device_id: u8, first_keycode: u8, keysyms_per_keycode: u8, keycode_count: u8, keysyms: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_get_device_modifier_mapping( &self, device_id: u8, ) -> Result<Cookie<'_, Self, GetDeviceModifierMappingReply>, ConnectionError>

Source§

fn xinput_set_device_modifier_mapping<'c, 'input>( &'c self, device_id: u8, keymaps: &'input [u8], ) -> Result<Cookie<'c, Self, SetDeviceModifierMappingReply>, ConnectionError>

Source§

fn xinput_get_device_button_mapping( &self, device_id: u8, ) -> Result<Cookie<'_, Self, GetDeviceButtonMappingReply>, ConnectionError>

Source§

fn xinput_set_device_button_mapping<'c, 'input>( &'c self, device_id: u8, map: &'input [u8], ) -> Result<Cookie<'c, Self, SetDeviceButtonMappingReply>, ConnectionError>

Source§

fn xinput_query_device_state( &self, device_id: u8, ) -> Result<Cookie<'_, Self, QueryDeviceStateReply>, ConnectionError>

Source§

fn xinput_device_bell( &self, device_id: u8, feedback_id: u8, feedback_class: u8, percent: i8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xinput_set_device_valuators<'c, 'input>( &'c self, device_id: u8, first_valuator: u8, valuators: &'input [i32], ) -> Result<Cookie<'c, Self, SetDeviceValuatorsReply>, ConnectionError>

Source§

fn xinput_get_device_control( &self, control_id: DeviceControl, device_id: u8, ) -> Result<Cookie<'_, Self, GetDeviceControlReply>, ConnectionError>

Source§

fn xinput_change_device_control( &self, control_id: DeviceControl, device_id: u8, control: DeviceCtl, ) -> Result<Cookie<'_, Self, ChangeDeviceControlReply>, ConnectionError>

Source§

fn xinput_list_device_properties( &self, device_id: u8, ) -> Result<Cookie<'_, Self, ListDevicePropertiesReply>, ConnectionError>

Source§

fn xinput_change_device_property<'c, 'input>( &'c self, property: u32, type_: u32, device_id: u8, mode: PropMode, num_items: u32, items: &'input ChangeDevicePropertyAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_delete_device_property( &self, property: u32, device_id: u8, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xinput_get_device_property( &self, property: u32, type_: u32, offset: u32, len: u32, device_id: u8, delete: bool, ) -> Result<Cookie<'_, Self, GetDevicePropertyReply>, ConnectionError>

Source§

fn xinput_xi_query_pointer<A>( &self, window: u32, deviceid: A, ) -> Result<Cookie<'_, Self, XIQueryPointerReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_warp_pointer<A>( &self, src_win: u32, dst_win: u32, src_x: i32, src_y: i32, src_width: u16, src_height: u16, dst_x: i32, dst_y: i32, deviceid: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_change_cursor<A>( &self, window: u32, cursor: u32, deviceid: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_change_hierarchy<'c, 'input>( &'c self, changes: &'input [HierarchyChange], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_xi_set_client_pointer<A>( &self, window: u32, deviceid: A, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_get_client_pointer( &self, window: u32, ) -> Result<Cookie<'_, Self, XIGetClientPointerReply>, ConnectionError>

Source§

fn xinput_xi_select_events<'c, 'input>( &'c self, window: u32, masks: &'input [EventMask], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_xi_query_version( &self, major_version: u16, minor_version: u16, ) -> Result<Cookie<'_, Self, XIQueryVersionReply>, ConnectionError>

Source§

fn xinput_xi_query_device<A>( &self, deviceid: A, ) -> Result<Cookie<'_, Self, XIQueryDeviceReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_set_focus<A, B>( &self, window: u32, time: A, deviceid: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u16>,

Source§

fn xinput_xi_get_focus<A>( &self, deviceid: A, ) -> Result<Cookie<'_, Self, XIGetFocusReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_grab_device<'c, 'input, A, B>( &'c self, window: u32, time: A, cursor: u32, deviceid: B, mode: GrabMode, paired_device_mode: GrabMode, owner_events: GrabOwner, mask: &'input [u32], ) -> Result<Cookie<'c, Self, XIGrabDeviceReply>, ConnectionError>
where A: Into<u32>, B: Into<u16>,

Source§

fn xinput_xi_ungrab_device<A, B>( &self, time: A, deviceid: B, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u16>,

Source§

fn xinput_xi_allow_events<A, B>( &self, time: A, deviceid: B, event_mode: EventMode, touchid: u32, grab_window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u32>, B: Into<u16>,

Source§

fn xinput_xi_passive_grab_device<'c, 'input, A, B>( &'c self, time: A, grab_window: u32, cursor: u32, detail: u32, deviceid: B, grab_type: GrabType, grab_mode: GrabMode22, paired_device_mode: GrabMode, owner_events: GrabOwner, mask: &'input [u32], modifiers: &'input [u32], ) -> Result<Cookie<'c, Self, XIPassiveGrabDeviceReply>, ConnectionError>
where A: Into<u32>, B: Into<u16>,

Source§

fn xinput_xi_passive_ungrab_device<'c, 'input, A>( &'c self, grab_window: u32, detail: u32, deviceid: A, grab_type: GrabType, modifiers: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_list_properties<A>( &self, deviceid: A, ) -> Result<Cookie<'_, Self, XIListPropertiesReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_change_property<'c, 'input, A>( &'c self, deviceid: A, mode: PropMode, property: u32, type_: u32, num_items: u32, items: &'input XIChangePropertyAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_delete_property<A>( &self, deviceid: A, property: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_get_property<A>( &self, deviceid: A, delete: bool, property: u32, type_: u32, offset: u32, len: u32, ) -> Result<Cookie<'_, Self, XIGetPropertyReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xinput_xi_get_selected_events( &self, window: u32, ) -> Result<Cookie<'_, Self, XIGetSelectedEventsReply>, ConnectionError>

Source§

fn xinput_xi_barrier_release_pointer<'c, 'input>( &'c self, barriers: &'input [BarrierReleasePointerInfo], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xinput_send_extension_event<'c, 'input>( &'c self, destination: u32, device_id: u8, propagate: bool, events: &'input [EventForSend], classes: &'input [u32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

impl<C> ConnectionExt for C

Source§

fn xkb_use_extension( &self, wanted_major: u16, wanted_minor: u16, ) -> Result<Cookie<'_, Self, UseExtensionReply>, ConnectionError>

Source§

fn xkb_select_events<'c, 'input>( &'c self, device_spec: u16, clear: EventType, select_all: EventType, affect_map: MapPart, map: MapPart, details: &'input SelectEventsAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_bell( &self, device_spec: u16, bell_class: u16, bell_id: u16, percent: i8, force_sound: bool, event_only: bool, pitch: i16, duration: i16, name: u32, window: u32, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xkb_get_state( &self, device_spec: u16, ) -> Result<Cookie<'_, Self, GetStateReply>, ConnectionError>

Source§

fn xkb_latch_lock_state( &self, device_spec: u16, affect_mod_locks: ModMask, mod_locks: ModMask, lock_group: bool, group_lock: Group, affect_mod_latches: ModMask, latch_group: bool, group_latch: u16, ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Source§

fn xkb_get_controls( &self, device_spec: u16, ) -> Result<Cookie<'_, Self, GetControlsReply>, ConnectionError>

Source§

fn xkb_set_controls<'c, 'input>( &'c self, device_spec: u16, affect_internal_real_mods: ModMask, internal_real_mods: ModMask, affect_ignore_lock_real_mods: ModMask, ignore_lock_real_mods: ModMask, affect_internal_virtual_mods: VMod, internal_virtual_mods: VMod, affect_ignore_lock_virtual_mods: VMod, ignore_lock_virtual_mods: VMod, mouse_keys_dflt_btn: u8, groups_wrap: u8, access_x_options: AXOption, affect_enabled_controls: BoolCtrl, enabled_controls: BoolCtrl, change_controls: Control, repeat_delay: u16, repeat_interval: u16, slow_keys_delay: u16, debounce_delay: u16, mouse_keys_delay: u16, mouse_keys_interval: u16, mouse_keys_time_to_max: u16, mouse_keys_max_speed: u16, mouse_keys_curve: i16, access_x_timeout: u16, access_x_timeout_mask: BoolCtrl, access_x_timeout_values: BoolCtrl, access_x_timeout_options_mask: AXOption, access_x_timeout_options_values: AXOption, per_key_repeat: &'input [u8; 32], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_get_map( &self, device_spec: u16, full: MapPart, partial: MapPart, first_type: u8, n_types: u8, first_key_sym: u8, n_key_syms: u8, first_key_action: u8, n_key_actions: u8, first_key_behavior: u8, n_key_behaviors: u8, virtual_mods: VMod, first_key_explicit: u8, n_key_explicit: u8, first_mod_map_key: u8, n_mod_map_keys: u8, first_v_mod_map_key: u8, n_v_mod_map_keys: u8, ) -> Result<Cookie<'_, Self, GetMapReply>, ConnectionError>

Source§

fn xkb_set_map<'c, 'input>( &'c self, device_spec: u16, flags: SetMapFlags, min_key_code: u8, max_key_code: u8, first_type: u8, n_types: u8, first_key_sym: u8, n_key_syms: u8, total_syms: u16, first_key_action: u8, n_key_actions: u8, total_actions: u16, first_key_behavior: u8, n_key_behaviors: u8, total_key_behaviors: u8, first_key_explicit: u8, n_key_explicit: u8, total_key_explicit: u8, first_mod_map_key: u8, n_mod_map_keys: u8, total_mod_map_keys: u8, first_v_mod_map_key: u8, n_v_mod_map_keys: u8, total_v_mod_map_keys: u8, virtual_mods: VMod, values: &'input SetMapAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_get_compat_map( &self, device_spec: u16, groups: SetOfGroup, get_all_si: bool, first_si: u16, n_si: u16, ) -> Result<Cookie<'_, Self, GetCompatMapReply>, ConnectionError>

Source§

fn xkb_set_compat_map<'c, 'input>( &'c self, device_spec: u16, recompute_actions: bool, truncate_si: bool, groups: SetOfGroup, first_si: u16, si: &'input [SymInterpret], group_maps: &'input [ModDef], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_get_indicator_state( &self, device_spec: u16, ) -> Result<Cookie<'_, Self, GetIndicatorStateReply>, ConnectionError>

Source§

fn xkb_get_indicator_map( &self, device_spec: u16, which: u32, ) -> Result<Cookie<'_, Self, GetIndicatorMapReply>, ConnectionError>

Source§

fn xkb_set_indicator_map<'c, 'input>( &'c self, device_spec: u16, which: u32, maps: &'input [IndicatorMap], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_get_named_indicator<A>( &self, device_spec: u16, led_class: LedClass, led_id: A, indicator: u32, ) -> Result<Cookie<'_, Self, GetNamedIndicatorReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xkb_set_named_indicator<A>( &self, device_spec: u16, led_class: LedClass, led_id: A, indicator: u32, set_state: bool, on: bool, set_map: bool, create_map: bool, map_flags: IMFlag, map_which_groups: IMGroupsWhich, map_groups: SetOfGroups, map_which_mods: IMModsWhich, map_real_mods: ModMask, map_vmods: VMod, map_ctrls: BoolCtrl, ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<u16>,

Source§

fn xkb_get_names( &self, device_spec: u16, which: NameDetail, ) -> Result<Cookie<'_, Self, GetNamesReply>, ConnectionError>

Source§

fn xkb_set_names<'c, 'input>( &'c self, device_spec: u16, virtual_mods: VMod, first_type: u8, n_types: u8, first_kt_levelt: u8, n_kt_levels: u8, indicators: u32, group_names: SetOfGroup, n_radio_groups: u8, first_key: u8, n_keys: u8, n_key_aliases: u8, total_kt_level_names: u16, values: &'input SetNamesAux, ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_per_client_flags( &self, device_spec: u16, change: PerClientFlag, value: PerClientFlag, ctrls_to_change: BoolCtrl, auto_ctrls: BoolCtrl, auto_ctrls_values: BoolCtrl, ) -> Result<Cookie<'_, Self, PerClientFlagsReply>, ConnectionError>

Source§

fn xkb_list_components( &self, device_spec: u16, max_names: u16, ) -> Result<Cookie<'_, Self, ListComponentsReply>, ConnectionError>

Source§

fn xkb_get_kbd_by_name( &self, device_spec: u16, need: GBNDetail, want: GBNDetail, load: bool, ) -> Result<Cookie<'_, Self, GetKbdByNameReply>, ConnectionError>

Source§

fn xkb_get_device_info<A>( &self, device_spec: u16, wanted: XIFeature, all_buttons: bool, first_button: u8, n_buttons: u8, led_class: LedClass, led_id: A, ) -> Result<Cookie<'_, Self, GetDeviceInfoReply>, ConnectionError>
where A: Into<u16>,

Source§

fn xkb_set_device_info<'c, 'input>( &'c self, device_spec: u16, first_btn: u8, change: XIFeature, btn_actions: &'input [Action], leds: &'input [DeviceLedInfo], ) -> Result<VoidCookie<'c, Self>, ConnectionError>

Source§

fn xkb_set_debugging_flags<'c, 'input>( &'c self, affect_flags: u32, flags: u32, affect_ctrls: u32, ctrls: u32, message: &'input [u8], ) -> Result<Cookie<'c, Self, SetDebuggingFlagsReply>, ConnectionError>

Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T, C, D> Curve<T> for D
where C: Curve<T> + ?Sized, D: Deref<Target = C>,

Source§

fn domain(&self) -> Interval

The interval over which this curve is parametrized. Read more
Source§

fn sample_unchecked(&self, t: f32) -> T

Sample a point on this curve at the parameter value t, extracting the associated value. This is the unchecked version of sampling, which should only be used if the sample time t is already known to lie within the curve’s domain. Read more
Source§

fn sample(&self, t: f32) -> Option<T>

Sample a point on this curve at the parameter value t, returning None if the point is outside of the curve’s domain.
Source§

fn sample_clamped(&self, t: f32) -> T

Sample a point on this curve at the parameter value t, clamping t to lie inside the domain of the curve.
Source§

impl<C, T> CurveExt<T> for C
where C: Curve<T>,

Source§

fn sample_iter( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = Option<T>>

Sample a collection of n >= 0 points on this curve at the parameter values t_n, returning None if the point is outside of the curve’s domain. Read more
Source§

fn sample_iter_unchecked( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = T>

Sample a collection of n >= 0 points on this curve at the parameter values t_n, extracting the associated values. This is the unchecked version of sampling, which should only be used if the sample times t_n are already known to lie within the curve’s domain. Read more
Source§

fn sample_iter_clamped( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = T>

Sample a collection of n >= 0 points on this curve at the parameter values t_n, clamping t_n to lie inside the domain of the curve. Read more
Source§

fn map<S, F>(self, f: F) -> MapCurve<T, S, Self, F>
where F: Fn(T) -> S,

Create a new curve by mapping the values of this curve via a function f; i.e., if the sample at time t for this curve is x, the value at time t on the new curve will be f(x).
Source§

fn reparametrize<F>(self, domain: Interval, f: F) -> ReparamCurve<T, Self, F>
where F: Fn(f32) -> f32,

Create a new Curve whose parameter space is related to the parameter space of this curve by f. For each time t, the sample from the new curve at time t is the sample from this curve at time f(t). The given domain will be the domain of the new curve. The function f is expected to take domain into self.domain(). Read more
Source§

fn reparametrize_linear( self, domain: Interval, ) -> Result<LinearReparamCurve<T, Self>, LinearReparamError>

Linearly reparametrize this Curve, producing a new curve whose domain is the given domain instead of the current one. This operation is only valid for curves with bounded domains. Read more
Source§

fn reparametrize_by_curve<C>(self, other: C) -> CurveReparamCurve<T, Self, C>
where C: Curve<f32>,

Reparametrize this Curve by sampling from another curve. Read more
Source§

fn graph(self) -> GraphCurve<T, Self>

Create a new Curve which is the graph of this one; that is, its output echoes the sample time as part of a tuple. Read more
Source§

fn zip<S, C>( self, other: C, ) -> Result<ZipCurve<T, S, Self, C>, InvalidIntervalError>
where C: Curve<S>,

Create a new Curve by zipping this curve together with another. Read more
Source§

fn chain<C>(self, other: C) -> Result<ChainCurve<T, Self, C>, ChainError>
where C: Curve<T>,

Create a new Curve by composing this curve end-to-start with another, producing another curve with outputs of the same type. The domain of the other curve is translated so that its start coincides with where this curve ends. Read more
Source§

fn reverse(self) -> Result<ReverseCurve<T, Self>, ReverseError>

Create a new Curve inverting this curve on the x-axis, producing another curve with outputs of the same type, effectively playing backwards starting at self.domain().end() and transitioning over to self.domain().start(). The domain of the new curve is still the same. Read more
Source§

fn repeat(self, count: usize) -> Result<RepeatCurve<T, Self>, RepeatError>

Create a new Curve repeating this curve N times, producing another curve with outputs of the same type. The domain of the new curve will be bigger by a factor of n + 1. Read more
Source§

fn forever(self) -> Result<ForeverCurve<T, Self>, RepeatError>

Create a new Curve repeating this curve forever, producing another curve with outputs of the same type. The domain of the new curve will be unbounded. Read more
Source§

fn ping_pong(self) -> Result<PingPongCurve<T, Self>, PingPongError>

Create a new Curve chaining the original curve with its inverse, producing another curve with outputs of the same type. The domain of the new curve will be twice as long. The transition point is guaranteed to not make any jumps. Read more
Source§

fn chain_continue<C>( self, other: C, ) -> Result<ContinuationCurve<T, Self, C>, ChainError>
where T: VectorSpace, C: Curve<T>,

Create a new Curve by composing this curve end-to-start with another, producing another curve with outputs of the same type. The domain of the other curve is translated so that its start coincides with where this curve ends. Read more
Source§

fn samples( &self, samples: usize, ) -> Result<impl Iterator<Item = T>, ResamplingError>

Extract an iterator over evenly-spaced samples from this curve. Read more
Source§

fn by_ref(&self) -> &Self

Borrow this curve rather than taking ownership of it. This is essentially an alias for a prefix &; the point is that intermediate operations can be performed while retaining access to the original curve. Read more
Source§

fn flip<U, V>(self) -> impl Curve<(V, U)>
where Self: CurveExt<(U, V)>,

Flip this curve so that its tuple output is arranged the other way.
Source§

impl<C, T> CurveResampleExt<T> for C
where C: Curve<T> + ?Sized,

Source§

fn resample<I>( &self, segments: usize, interpolation: I, ) -> Result<SampleCurve<T, I>, ResamplingError>
where I: Fn(&T, &T, f32) -> T,

Resample this Curve to produce a new one that is defined by interpolation over equally spaced sample values, using the provided interpolation to interpolate between adjacent samples. The curve is interpolated on segments segments between samples. For example, if segments is 1, only the start and end points of the curve are used as samples; if segments is 2, a sample at the midpoint is taken as well, and so on. Read more
Source§

fn resample_auto( &self, segments: usize, ) -> Result<SampleAutoCurve<T>, ResamplingError>

Resample this Curve to produce a new one that is defined by interpolation over equally spaced sample values, using automatic interpolation to interpolate between adjacent samples. The curve is interpolated on segments segments between samples. For example, if segments is 1, only the start and end points of the curve are used as samples; if segments is 2, a sample at the midpoint is taken as well, and so on. Read more
Source§

fn resample_uneven<I>( &self, sample_times: impl IntoIterator<Item = f32>, interpolation: I, ) -> Result<UnevenSampleCurve<T, I>, ResamplingError>
where I: Fn(&T, &T, f32) -> T,

Resample this Curve to produce a new one that is defined by interpolation over samples taken at a given set of times. The given interpolation is used to interpolate adjacent samples, and the sample_times are expected to contain at least two valid times within the curve’s domain interval. Read more
Source§

fn resample_uneven_auto( &self, sample_times: impl IntoIterator<Item = f32>, ) -> Result<UnevenSampleAutoCurve<T>, ResamplingError>

Resample this Curve to produce a new one that is defined by automatic interpolation over samples taken at the given set of times. The given sample_times are expected to contain at least two valid times within the curve’s domain interval. Read more
Source§

impl<T, C> CurveWithDerivative<T> for C
where T: HasTangent, C: SampleDerivative<T>,

Source§

fn with_derivative(self) -> SampleDerivativeWrapper<C>

This curve, but with its first derivative included in sampling. Read more
Source§

impl<T> DisplayAndWindowHandle for T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<T> DynHash for T
where T: DynEq + Hash,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
Source§

impl<T> DynamicType for T
where T: Type + ?Sized,

Source§

fn signature(&self) -> Signature

The type signature for self. Read more
Source§

impl<T> DynamicTypePath for T
where T: TypePath,

Source§

impl<T> DynamicTyped for T
where T: Typed,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<F, S> FilterExt<S> for F
where F: Filter<S>,

Source§

fn and<B>(self, other: B) -> And<Self, B, S>
where Self: Sized, B: Filter<S>,

Combines this Filter with another Filter s so that spans and events are enabled if and only if both filters return true. Read more
Source§

fn or<B>(self, other: B) -> Or<Self, B, S>
where Self: Sized, B: Filter<S>,

Combines two Filters so that spans and events are enabled if either filter returns true. Read more
Source§

fn not(self) -> Not<Self, S>
where Self: Sized,

Inverts self, returning a filter that enables spans and events only if self would not enable them. Read more
Source§

fn boxed(self) -> Box<dyn Filter<S> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

Boxes self, erasing its concrete type. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

Source§

type Template = T

The Template for this type.
Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

Source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
Source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
Source§

fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
Source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>>
where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
Source§

impl<T> GpuArrayBufferable for T

Source§

impl<T> HasRawDisplayHandle for T
where T: HasDisplayHandle + ?Sized,

Source§

fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError>

👎Deprecated:

Use HasDisplayHandle instead

Source§

impl<T> HasRawWindowHandle for T
where T: HasWindowHandle + ?Sized,

Source§

fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError>

👎Deprecated:

Use HasWindowHandle instead

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> HitDataExtra for T
where T: Send + Sync + Debug + Any + 'static,

Source§

impl<T, B1, B2> HttpService<B1> for T
where T: Service<Request<B1>, Response = Response<B2>>, B2: Body, <T as Service<Request<B1>>>::Error: Into<Box<dyn Error + Send + Sync>>,

Source§

type ResBody = B2

The Body body of the Response.
Source§

type Error = <T as Service<Request<B1>>>::Error

The error type that can occur within this Service. Read more
Source§

type Future = <T as Service<Request<B1>>>::Future

The Future returned by this Service.
Source§

fn call(&mut self, req: Request<B1>) -> <T as HttpService<B1>>::Future

Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
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<E> InstrumentError for E
where TracedError<E>: From<E>,

Source§

type Instrumented = TracedError<E>

The type of the wrapped error after instrumentation
Source§

fn in_current_span(self) -> <E as InstrumentError>::Instrumented

Instrument an Error by bundling it with a SpanTrace Read more
Source§

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

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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<Sp> LocalSpawnExt for Sp
where Sp: LocalSpawn + ?Sized,

Source§

fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where Fut: Future<Output = ()> + 'static,

Available on crate feature alloc only.
Spawns a task that polls the given future with output () to completion. Read more
Source§

impl<'a, M> MakeWriterExt<'a> for M
where M: MakeWriter<'a>,

Source§

fn with_max_level(self, level: Level) -> WithMaxLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or below the provided verbosity Level. For instance, Level::TRACE is considered to be _more verbosethanLevel::INFO`. Read more
Source§

fn with_min_level(self, level: Level) -> WithMinLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or above the provided verbosity Level. Read more
Source§

fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>
where Self: Sized, F: Fn(&Metadata<'_>) -> bool,

Wraps self with a predicate that takes a span or event’s Metadata and returns a bool. The returned MakeWriter’s MakeWriter::make_writer_for method will check the predicate to determine if a writer should be produced for a given span or event. Read more
Source§

fn and<B>(self, other: B) -> Tee<Self, B> ⓘ
where Self: Sized, B: MakeWriter<'a>,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that produces writers that write to both outputs. Read more
Source§

fn or_else<W, B>(self, other: B) -> OrElse<Self, B>
where Self: Sized + MakeWriter<'a, Writer = EitherWriter<W, Sink>>, B: MakeWriter<'a>, W: Write,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that calls other’s make_writer if self’s make_writer returns OptionalWriter::none. Read more
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<S, T> ParallelSlice<T> for S
where T: Sync, S: AsRef<[T]>,

Source§

fn par_chunk_map<F, R>( &self, task_pool: &TaskPool, chunk_size: usize, f: F, ) -> Vec<R>
where F: Fn(usize, &[T]) -> R + Send + Sync, R: Send + 'static,

Splits the slice in chunks of size chunks_size or less and maps the chunks in parallel across the provided task_pool. One task is spawned in the task pool for every chunk. Read more
Source§

fn par_splat_map<F, R>( &self, task_pool: &TaskPool, max_tasks: Option<usize>, f: F, ) -> Vec<R>
where F: Fn(usize, &[T]) -> R + Send + Sync, R: Send + 'static,

Splits the slice into a maximum of max_tasks chunks, and maps the chunks in parallel across the provided task_pool. One task is spawned in the task pool for every chunk. Read more
Source§

impl<G> PatchFromTemplate for G
where G: FromTemplate,

Source§

type Template = <G as FromTemplate>::Template

The Template that will be patched.
Source§

fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
where F: FnOnce(&mut <G as PatchFromTemplate>::Template, &mut ResolveContext<'_>),

Takes a “patch function” func, and turns it into a TemplatePatch.
Source§

impl<T> PatchTemplate for T
where T: Template,

Source§

fn patch_template<F>(func: F) -> TemplatePatch<F, T>
where F: FnOnce(&mut T, &mut ResolveContext<'_>),

Takes a “patch function” func that patches this Template, and turns it into a TemplatePatch.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R> ReadBytes for R
where R: Read,

Source§

fn read_u8(&mut self, endian: Endian) -> Result<u8, Error>

Read a u8.
Source§

fn read_u16(&mut self, endian: Endian) -> Result<u16, Error>

Read a u16.
Source§

fn read_u32(&mut self, endian: Endian) -> Result<u32, Error>

Read a u32.
Source§

fn read_u64(&mut self, endian: Endian) -> Result<u64, Error>

Read a u64.
Source§

fn read_u128(&mut self, endian: Endian) -> Result<u128, Error>

Read a u128.
Source§

fn read_i8(&mut self, endian: Endian) -> Result<i8, Error>

Read a i8.
Source§

fn read_i16(&mut self, endian: Endian) -> Result<i16, Error>

Read a i16.
Source§

fn read_i32(&mut self, endian: Endian) -> Result<i32, Error>

Read a i32.
Source§

fn read_i64(&mut self, endian: Endian) -> Result<i64, Error>

Read a i64.
Source§

fn read_i128(&mut self, endian: Endian) -> Result<i128, Error>

Read a i128.
Source§

fn read_f32(&mut self, endian: Endian) -> Result<f32, Error>

Read a f32.
Source§

fn read_f64(&mut self, endian: Endian) -> Result<f64, Error>

Read a f64.
Source§

impl<R> ReadBytesExt for R
where R: Read + ?Sized,

Source§

fn read_u8(&mut self) -> Result<u8, Error>

Reads an unsigned 8 bit integer from the underlying reader. Read more
Source§

fn read_i8(&mut self) -> Result<i8, Error>

Reads a signed 8 bit integer from the underlying reader. Read more
Source§

fn read_u16<T>(&mut self) -> Result<u16, Error>
where T: ByteOrder,

Reads an unsigned 16 bit integer from the underlying reader. Read more
Source§

fn read_i16<T>(&mut self) -> Result<i16, Error>
where T: ByteOrder,

Reads a signed 16 bit integer from the underlying reader. Read more
Source§

fn read_u24<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 24 bit integer from the underlying reader. Read more
Source§

fn read_i24<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 24 bit integer from the underlying reader. Read more
Source§

fn read_u32<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 32 bit integer from the underlying reader. Read more
Source§

fn read_i32<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 32 bit integer from the underlying reader. Read more
Source§

fn read_u48<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 48 bit integer from the underlying reader. Read more
Source§

fn read_i48<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 48 bit integer from the underlying reader. Read more
Source§

fn read_u64<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 64 bit integer from the underlying reader. Read more
Source§

fn read_i64<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 64 bit integer from the underlying reader. Read more
Source§

fn read_u128<T>(&mut self) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned 128 bit integer from the underlying reader. Read more
Source§

fn read_i128<T>(&mut self) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed 128 bit integer from the underlying reader. Read more
Source§

fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader. Read more
Source§

fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader. Read more
Source§

fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader.
Source§

fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader.
Source§

fn read_f32<T>(&mut self) -> Result<f32, Error>
where T: ByteOrder,

Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
Source§

fn read_f64<T>(&mut self) -> Result<f64, Error>
where T: ByteOrder,

Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
Source§

fn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more
Source§

fn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more
Source§

fn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more
Source§

fn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more
Source§

fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>

Reads a sequence of signed 8 bit integers from the underlying reader. Read more
Source§

fn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 16 bit integers from the underlying reader. Read more
Source§

fn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 32 bit integers from the underlying reader. Read more
Source§

fn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 64 bit integers from the underlying reader. Read more
Source§

fn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 128 bit integers from the underlying reader. Read more
Source§

fn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more
Source§

fn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where T: ByteOrder,

👎Deprecated since 1.2.0:

please use read_f32_into instead

DEPRECATED. Read more
Source§

fn read_f64_into<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of IEEE754 double-precision (8 bytes) floating point numbers from the underlying reader. Read more
Source§

fn read_f64_into_unchecked<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where T: ByteOrder,

👎Deprecated since 1.2.0:

please use read_f64_into instead

DEPRECATED. Read more
Source§

impl<R> ReadBytesExt for R
where R: Read + ?Sized,

Source§

fn read_u8(&mut self) -> Result<u8, Error>

Reads an unsigned 8 bit integer from the underlying reader. Read more
Source§

fn read_i8(&mut self) -> Result<i8, Error>

Reads a signed 8 bit integer from the underlying reader. Read more
Source§

fn read_u16<T>(&mut self) -> Result<u16, Error>
where T: ByteOrder,

Reads an unsigned 16 bit integer from the underlying reader. Read more
Source§

fn read_i16<T>(&mut self) -> Result<i16, Error>
where T: ByteOrder,

Reads a signed 16 bit integer from the underlying reader. Read more
Source§

fn read_u24<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 24 bit integer from the underlying reader. Read more
Source§

fn read_i24<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 24 bit integer from the underlying reader. Read more
Source§

fn read_u32<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 32 bit integer from the underlying reader. Read more
Source§

fn read_i32<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 32 bit integer from the underlying reader. Read more
Source§

fn read_u48<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 48 bit integer from the underlying reader. Read more
Source§

fn read_i48<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 48 bit integer from the underlying reader. Read more
Source§

fn read_u64<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 64 bit integer from the underlying reader. Read more
Source§

fn read_i64<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 64 bit integer from the underlying reader. Read more
Source§

fn read_u128<T>(&mut self) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned 128 bit integer from the underlying reader. Read more
Source§

fn read_i128<T>(&mut self) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed 128 bit integer from the underlying reader. Read more
Source§

fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader. Read more
Source§

fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader. Read more
Source§

fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader.
Source§

fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader.
Source§

fn read_f32<T>(&mut self) -> Result<f32, Error>
where T: ByteOrder,

Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
Source§

fn read_f64<T>(&mut self) -> Result<f64, Error>
where T: ByteOrder,

Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
Source§

impl<R> ReadEndian<[f32]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [f32], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [f32]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[f64]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [f64], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [f64]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[i8]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [i8], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [i8]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[i16]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [i16], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [i16]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[i32]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [i32], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [i32]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[i64]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [i64], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [i64]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[i128]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [i128], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [i128]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[u8]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [u8], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [u8]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[u16]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [u16], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [u16]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[u32]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [u32], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [u32]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[u64]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [u64], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [u64]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<[u128]> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut [u128], ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut [u128]) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<f32> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut f32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut f32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<f64> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut f64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut f64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<i8> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut i8) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut i8) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<i16> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut i16) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut i16) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<i32> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut i32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut i32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<i64> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut i64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut i64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<i128> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut i128, ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut i128) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<u8> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut u8) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut u8) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<u16> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut u16) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut u16) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<u32> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut u32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut u32) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<u64> for R
where R: Read,

Source§

fn read_from_little_endian_into(&mut self, value: &mut u64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut u64) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R> ReadEndian<u128> for R
where R: Read,

Source§

fn read_from_little_endian_into( &mut self, value: &mut u128, ) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_big_endian_into(&mut self, value: &mut u128) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>

Read into the supplied reference. Acts the same as std::io::Read::read_exact.
Source§

fn read_from_little_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_big_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

fn read_from_native_endian(&mut self) -> Result<T, Error>
where T: Sized + Default,

Read the byte value of the inferred type
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Reflectable for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, C, D> SampleDerivative<T> for D
where T: HasTangent, C: SampleDerivative<T> + ?Sized, D: Deref<Target = C>,

Source§

fn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>

Sample this curve at the parameter value t, extracting the associated value in addition to its derivative. This is the unchecked version of sampling, which should only be used if the sample time t is already known to lie within the curve’s domain. Read more
Source§

fn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>>

Sample this curve’s value and derivative at the parameter value t, returning None if the point is outside of the curve’s domain.
Source§

fn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T>

Sample this curve’s value and derivative at the parameter value t, clamping t to lie inside the domain of the curve.
Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<T> Source for T
where T: Deref, <T as Deref>::Target: Source,

Source§

type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a

A type this Source can be sliced into.
Source§

fn len(&self) -> usize

Length of the source
Source§

fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>
where Chunk: Chunk<'a>,

Read a chunk of bytes into an array. Returns None when reading out of bounds would occur. Read more
Source§

fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>

Get a slice of the source at given range. This is analogous to slice::get(range). Read more
Source§

unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>

Available on non-crate feature forbid_unsafe only.
Get a slice of the source at given range. This is analogous to slice::get_unchecked(range). Read more
Source§

fn is_boundary(&self, index: usize) -> bool

Check if index is valid for this Source, that is: Read more
Source§

fn find_boundary(&self, index: usize) -> usize

For &str sources attempts to find the closest char boundary at which source can be sliced, starting from index. Read more
Source§

impl<T> Spanned for T
where T: Spanned + ?Sized,

Source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty.
Source§

impl<Sp> SpawnExt for Sp
where Sp: Spawn + ?Sized,

Source§

fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where Fut: Future<Output = ()> + Send + 'static,

Available on crate feature alloc only.
Spawns a task that polls the given future with output () to completion. Read more
Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<S> SubscriberExt for S
where S: Subscriber,

Source§

fn with<L>(self, layer: L) -> Layered<L, Self>
where L: Layer<Self>, Self: Sized,

Wraps self with the provided layer.
Source§

impl<T> SubscriberInitExt for T
where T: Into<Dispatch>,

Source§

fn set_default(self) -> DefaultGuard

Available on crate feature std only.
Sets self as the default subscriber in the current scope, returning a guard that will unset it when dropped. Read more
Source§

fn try_init(self) -> Result<(), TryInitError>

Attempts to set self as the global default subscriber in the current scope, returning an error if one is already set. Read more
Source§

fn init(self)

Attempts to set self as the global default subscriber in the current scope, panicking if this fails. Read more
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> Template for T
where T: Clone + Unpin,

Source§

type Output = T

The type of value produced by this Template.
Source§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a Template::Output.
Source§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
Source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of self.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WgpuHasDisplayHandle for T
where T: HasDisplayHandle + Debug + Send + Sync + 'static,

Source§

impl<T> WindowHandle for T

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
Source§

impl<W> WriteBytes for W
where W: Write,

Source§

fn write_u8(&mut self, endian: Endian, n: u8) -> Result<(), Error>

Write a u8.
Source§

fn write_u16(&mut self, endian: Endian, n: u16) -> Result<(), Error>

Write a u16.
Source§

fn write_u32(&mut self, endian: Endian, n: u32) -> Result<(), Error>

Write a u32.
Source§

fn write_u64(&mut self, endian: Endian, n: u64) -> Result<(), Error>

Write a u64.
Source§

fn write_u128(&mut self, endian: Endian, n: u128) -> Result<(), Error>

Write a u128.
Source§

fn write_i8(&mut self, endian: Endian, n: i8) -> Result<(), Error>

Write a i8.
Source§

fn write_i16(&mut self, endian: Endian, n: i16) -> Result<(), Error>

Write a i16.
Source§

fn write_i32(&mut self, endian: Endian, n: i32) -> Result<(), Error>

Write a i32.
Source§

fn write_i64(&mut self, endian: Endian, n: i64) -> Result<(), Error>

Write a i64.
Source§

fn write_i128(&mut self, endian: Endian, n: i128) -> Result<(), Error>

Write a i128.
Source§

fn write_f32(&mut self, endian: Endian, n: f32) -> Result<(), Error>

Write a f32.
Source§

fn write_f64(&mut self, endian: Endian, n: f64) -> Result<(), Error>

Write a f64.
Source§

impl<W> WriteBytesExt for W
where W: Write + ?Sized,

Source§

fn write_u8(&mut self, n: u8) -> Result<(), Error>

Writes an unsigned 8 bit integer to the underlying writer. Read more
Source§

fn write_i8(&mut self, n: i8) -> Result<(), Error>

Writes a signed 8 bit integer to the underlying writer. Read more
Source§

fn write_u16<T>(&mut self, n: u16) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 16 bit integer to the underlying writer. Read more
Source§

fn write_i16<T>(&mut self, n: i16) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 16 bit integer to the underlying writer. Read more
Source§

fn write_u24<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 24 bit integer to the underlying writer. Read more
Source§

fn write_i24<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 24 bit integer to the underlying writer. Read more
Source§

fn write_u32<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 32 bit integer to the underlying writer. Read more
Source§

fn write_i32<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 32 bit integer to the underlying writer. Read more
Source§

fn write_u48<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 48 bit integer to the underlying writer. Read more
Source§

fn write_i48<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 48 bit integer to the underlying writer. Read more
Source§

fn write_u64<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 64 bit integer to the underlying writer. Read more
Source§

fn write_i64<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 64 bit integer to the underlying writer. Read more
Source§

fn write_u128<T>(&mut self, n: u128) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 128 bit integer to the underlying writer.
Source§

fn write_i128<T>(&mut self, n: i128) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 128 bit integer to the underlying writer.
Source§

fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_f32<T>(&mut self, n: f32) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more
Source§

fn write_f64<T>(&mut self, n: f64) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more
Source§

impl<W> WriteBytesExt for W
where W: Write + ?Sized,

Source§

fn write_u8(&mut self, n: u8) -> Result<(), Error>

Writes an unsigned 8 bit integer to the underlying writer. Read more
Source§

fn write_i8(&mut self, n: i8) -> Result<(), Error>

Writes a signed 8 bit integer to the underlying writer. Read more
Source§

fn write_u16<T>(&mut self, n: u16) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 16 bit integer to the underlying writer. Read more
Source§

fn write_i16<T>(&mut self, n: i16) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 16 bit integer to the underlying writer. Read more
Source§

fn write_u24<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 24 bit integer to the underlying writer. Read more
Source§

fn write_i24<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 24 bit integer to the underlying writer. Read more
Source§

fn write_u32<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 32 bit integer to the underlying writer. Read more
Source§

fn write_i32<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 32 bit integer to the underlying writer. Read more
Source§

fn write_u48<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 48 bit integer to the underlying writer. Read more
Source§

fn write_i48<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 48 bit integer to the underlying writer. Read more
Source§

fn write_u64<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 64 bit integer to the underlying writer. Read more
Source§

fn write_i64<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 64 bit integer to the underlying writer. Read more
Source§

fn write_u128<T>(&mut self, n: u128) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 128 bit integer to the underlying writer.
Source§

fn write_i128<T>(&mut self, n: i128) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 128 bit integer to the underlying writer.
Source§

fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_f32<T>(&mut self, n: f32) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more
Source§

fn write_f64<T>(&mut self, n: f64) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more
Source§

impl<W> WriteEndian<[f32]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[f32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[f32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[f64]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[f64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[f64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[i8]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[i8]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[i8]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[i16]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[i16]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[i16]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[i32]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[i32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[i32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[i64]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[i64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[i64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[i128]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[i128]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[i128]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[u8]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[u8]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[u8]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[u16]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[u16]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[u16]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[u32]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[u32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[u32]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[u64]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[u64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[u64]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<[u128]> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &[u128]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &[u128]) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<f32> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &f32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &f32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<f64> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &f64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &f64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<i8> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &i8) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &i8) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<i16> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &i16) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &i16) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<i32> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &i32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &i32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<i64> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &i64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &i64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<i128> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &i128) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &i128) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<u8> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &u8) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &u8) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<u16> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &u16) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &u16) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<u32> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &u32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &u32) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<u64> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &u64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &u64) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<W> WriteEndian<u128> for W
where W: Write,

Source§

fn write_as_little_endian(&mut self, value: &u128) -> Result<(), Error>

Write the byte value of the specified reference, converting it to little endianness
Source§

fn write_as_big_endian(&mut self, value: &u128) -> Result<(), Error>

Write the byte value of the specified reference, converting it to big endianness
Source§

fn write_as_native_endian(&mut self, value: &T) -> Result<(), Error>

Write the byte value of the specified reference, not converting it
Source§

impl<T> ZByteWriterTrait for T
where T: Write,

Source§

fn write_bytes(&mut self, buf: &[u8]) -> Result<usize, ZByteIoError>

Write some bytes into the sink returning number of bytes written or an error if something bad happened Read more
Source§

fn write_all_bytes(&mut self, buf: &[u8]) -> Result<(), ZByteIoError>

Write all bytes to the buffer or return an error if something occurred Read more
Source§

fn write_const_bytes<const N: usize>( &mut self, buf: &[u8; N], ) -> Result<(), ZByteIoError>

Write a fixed number of bytes and error out if we can’t write the bytes Read more
Source§

fn flush_bytes(&mut self) -> Result<(), ZByteIoError>

Ensure bytes are written to the sink. Read more
Source§

fn reserve_capacity(&mut self, _: usize) -> Result<(), ZByteIoError>

A hint to tell the implementation how big of a size we expect the image to be An implementation like in memory Vec can use this to reserve additional memory to prevent reallocation when encoding Read more