Struct bevy::utils::smallvec::alloc::sync::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 need to mutate through an Arc, use Mutex, RwLock, or one of the Atomic types.

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::SeqCst);
        println!("{v:?}");
    });
}

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

Implementations§

source§

impl<T> Arc<T>

source

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

Constructs a new Arc<T>.

Examples
use std::sync::Arc;

let five = Arc::new(5);
1.60.0 · source

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

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 {
    /// Construct 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() }
        })
    }

    /// Return a reference counted pointer to Self.
    fn me(&self) -> Arc<Self> {
        self.me.upgrade().unwrap()
    }
}
source

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

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

Constructs a new Arc with uninitialized contents.

Examples
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]

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

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

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

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
#![feature(new_uninit)]

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>>

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_api)

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_api)

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

Examples
#![feature(allocator_api)]
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_api)

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

Examples
#![feature(new_uninit, allocator_api)]
#![feature(get_mut_unchecked)]

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_api)

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(new_uninit, allocator_api)]

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 allocator(this: &Arc<T, A>) -> &A

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

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 new_in(data: T, alloc: A) -> Arc<T, A>

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

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

Examples
#![feature(allocator_api)]

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_api)

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

Examples
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]
#![feature(allocator_api)]

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_api)

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(new_uninit)]
#![feature(allocator_api)]

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 pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>

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

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>

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

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_api)

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

Examples
#![feature(allocator_api)]

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_api)

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

Examples
#![feature(new_uninit, allocator_api)]
#![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_api)

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(new_uninit, allocator_api)]

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 want to keep the Arc in the Err case. Immediately dropping the Err payload, like in the expression Arc::try_unwrap(this).ok(), can still cause the strong count to drop to zero and the inner value of the Arc to be dropped: For instance if two threads each execute this expression in parallel, then there is a race condition. The threads could first both check whether they have the last clone of their Arc via Arc::try_unwrap, and then both drop their Arc in the call to ok, taking the strong count from two down to zero.

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.

The similar expression Arc::try_unwrap(this).ok() does not offer such a guarantee. See the last example below and 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();
for i in 0..100000 {
    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();
source§

impl<T> Arc<[T]>

source

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

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

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

Examples
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]

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

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

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

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
#![feature(new_uninit)]

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. (new_uninit)

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

Examples
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]
#![feature(allocator_api)]

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. (new_uninit)

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(new_uninit)]
#![feature(allocator_api)]

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§

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

source

pub unsafe fn assume_init(self) -> Arc<T, A>
where A: Clone,

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

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
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]

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, A> Arc<[MaybeUninit<T>], A>
where A: Allocator,

source

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

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

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
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]

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 where U must have the same size and alignment as T. This is trivially true if U is T. Note that if U 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 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!
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 the associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method.

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 the associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method. 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§

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

1.17.0 · source

pub fn into_raw(this: Arc<T, A>) -> *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.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_api)

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 where U must have the same size and alignment as T. This is trivially true if U is T. Note that if U 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_api)]

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

let x = Arc::new_in("hello".to_owned(), System);
let x_ptr = Arc::into_raw(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!
1.4.0 · source

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

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: Clone,

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

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 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_api)]

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

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

unsafe {
    let ptr = Arc::into_raw(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_api)

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, 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_api)]

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

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

unsafe {
    let ptr = Arc::into_raw(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>
where T: Clone, A: Allocator + Clone,

1.4.0 · source

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

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());
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 Rc (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().into();
    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
source§

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

1.29.0 · source

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

Attempt 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.64.0 · source§

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

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>

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, 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<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§

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

source§

fn calculate_size_for(nr_of_el: u64) -> NonZeroU64

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

impl<T, A> Clone for Arc<T, A>
where A: Allocator + Clone, 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);
source§

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

Performs copy-assignment from source. Read more
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> CreateFrom for Arc<T>
where T: CreateFrom + ?Sized,

source§

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

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
source§

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

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);
source§

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

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
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
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!"
1.52.0 · source§

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

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
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)>

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
source§

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

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.21.0 · source§

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

source§

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

Allocate a reference-counted slice and fill 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.24.0 · source§

impl From<&CStr> for Arc<CStr>

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.

1.21.0 · source§

impl From<&str> for Arc<str>

source§

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

Allocate a reference-counted str and copy v into it.

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

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

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[..]);
1.51.0 · source§

impl<W> From<Arc<W>> for RawWaker
where W: Wake + Send + Sync + 'static,

source§

fn from(waker: Arc<W>) -> RawWaker

Use a Wake-able type as a RawWaker.

No heap allocations or atomic operations are used for this conversion.

1.51.0 · source§

impl<W> From<Arc<W>> for Waker
where W: Wake + Send + Sync + 'static,

source§

fn from(waker: Arc<W>) -> Waker

Use a Wake-able type as a Waker.

No heap allocations or atomic operations are used for this conversion.

source§

impl From<Arc<dyn Font + Send + Sync>> for FontArc

source§

fn from(font: Arc<dyn Font + Send + Sync>) -> FontArc

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());
source§

impl From<Arc<str>> for SmolStr

source§

fn from(s: Arc<str>) -> SmolStr

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

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

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>

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>

Create 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>

source§

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

Allocate a reference-counted str and copy 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>

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);
1.21.0 · source§

impl<T, A> From<Vec<T, A>> for Arc<[T], A>
where A: Allocator + Clone,

source§

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

Allocate a reference-counted slice and move 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.37.0 · source§

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

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, Arc<T>: Any + Send + Sync,

source§

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

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

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

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

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

source§

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

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,

source§

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

Get a handle to the window.
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> Log for Arc<T>
where T: Log + ?Sized,

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.
source§

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

§

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
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 · source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · source§

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

Restrict a value to a certain interval. Read more
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));
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, 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.
1.73.0 · source§

impl Read for Arc<File>

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_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

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

fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> 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 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>

Read 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>

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

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

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

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

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

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

Creates a “by reference” adaptor for this instance of Read. Read more
source§

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

Transforms this Read instance to an Iterator over its bytes. Read more
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
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§

impl<T> Reflect for Arc<T>
where T: Send + Sync + TypePath, 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 into_any(self: Box<Arc<T>>) -> Box<dyn Any>

Returns the value as a Box<dyn Any>.
source§

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

Returns the value as a &dyn Any.
source§

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

Returns the value as a &mut dyn Any.
source§

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

Casts this type to a boxed reflected value.
source§

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

Casts this type to a reflected value.
source§

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

Casts this type to a mutable reflected value.
source§

fn clone_value(&self) -> Box<dyn Reflect>

Clones the value as a Reflect trait object. Read more
source§

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

Applies a reflected value to this value. Read more
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§

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 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 Reflect + 'static)) -> Option<bool>

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

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

Debug formatter for the value. Read more
source§

fn serializable(&self) -> Option<Serializable<'_>>

Returns a serializable version of the value. Read more
source§

fn is_dynamic(&self) -> bool

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

impl<C> RequestConnection for Arc<C>

§

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.
1.73.0 · source§

impl Seek for Arc<File>

source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · 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
1.51.0 · 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>

🔬This is a nightly-only experimental API. (seek_seek_relative)
Seeks relative to the current position. Read more
source§

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

source§

const SHADER_SIZE: NonZeroU64 = 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) -> NonZeroU64

Returns the size of Self at runtime Read more
source§

fn min_size() -> NonZeroU64

Represents the minimum size of Self (equivalent to GPUBufferBindingLayout.minBindingSize) Read more
source§

fn assert_uniform_compat()

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.43.0 · source§

impl<T, A, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A>
where A: Allocator + Clone,

§

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> TypePath for Arc<T>
where T: Send + Sync + TypePath, 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, Arc<T>: Any + Send + Sync,

source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
1.73.0 · source§

impl Write for Arc<File>

source§

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

Write 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>

Flush 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
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<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, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where T: Unsize<U> + ?Sized, A: Allocator, U: ?Sized,

source§

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

source§

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

source§

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

source§

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

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>

Auto Trait Implementations§

§

impl<T: ?Sized, A> RefUnwindSafe for Arc<T, A>

Blanket Implementations§

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<Image>) -> 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<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<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<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<A, B, 'c, 'input>( &'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 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 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 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<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 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
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 bigreq_enable( &self ) -> Result<Cookie<'_, Self, EnableReply>, ConnectionError>

Enable the BIG-REQUESTS extension. Read more
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 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<A, 'c, 'input>( &'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<A, B, 'c, 'input>( &'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<A, B, 'c, 'input>( &'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<A, B, 'c, 'input>( &'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<A, B, 'c, 'input>( &'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<A, 'c, 'input>( &'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<A, 'c, 'input>( &'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 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<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

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> 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<T> DynEq for T
where T: Any + Eq,

source§

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

Casts the type to dyn Any.
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 as_dyn_eq(&self) -> &(dyn DynEq + 'static)

Casts the type to dyn Any.
source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
source§

impl<T> DynamicTypePath for T
where T: TypePath,

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

Compare self to key and return true if they are equal.
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> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
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> FromWorld for T
where T: Default,

source§

fn from_world(_world: &mut World) -> T

Creates Self using data from the given World.
source§

impl<T> GetPath for T
where T: Reflect + ?Sized,

source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p> ) -> Result<&(dyn Reflect + '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 Reflect + '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> 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> Instrument for T

source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for 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<'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: MakeWriter<'a, Writer = EitherWriter<W, Sink>> + Sized, 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<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(&[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(&[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<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<T> SubscriberInitExt for T
where T: Into<Dispatch>,

source§

fn set_default(self) -> DefaultGuard

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> ToOwned for T
where T: Clone,

§

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§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&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> 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<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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

source§

impl<T> GpuArrayBufferable for T

source§

impl<T> Settings for T
where T: 'static + Send + Sync,

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> WindowHandle for T