Skip to main content

WebGpu

Struct WebGpu 

Source
pub struct WebGpu { /* private fields */ }
Expand description

A Gpu on a WebGPU Device.

A shader’s groups are WebGPU bind groups, made with the bindings. globalIndex is a dynamic offset into a table of indices. Draws record into a pass of the frame’s command encoder at once, setting only what changed since the draw before.

Small buffers share larger ones, so that buffers made together sit together, their writes join one copy, and a frame that remakes many small buffers makes few wgpu buffers. Writes are gathered and copied into place ahead of the next flush’s commands.

On a browser’s WebGPU, a create_* call returns before the browser validates it, so a rejected descriptor reaches the device’s uncaptured-error callback instead of the call’s result.

Implementations§

Source§

impl WebGpu

Source

pub fn new(device: &Device) -> WebGpu

Source

pub fn import_texture(&mut self, texture: &Texture) -> TextureId

Takes a texture made elsewhere, such as a surface’s frame, as a texture of this backend. Destroying it drops this backend’s reference.

Trait Implementations§

Source§

impl Gpu for WebGpu

Source§

fn generate_mipmaps(&mut self, texture: TextureId) -> Result<(), GpuError>

Draws each level from the one before, in a pass of its own.

Source§

fn destroy(&mut self, resource: ResourceId) -> Result<(), GpuError>

Drops this backend’s references: wgpu keeps a resource while bindings, geometry or recorded commands hold it.

Source§

fn lend(&mut self, f: &mut dyn FnMut(&mut dyn Any)) -> Result<(), GpuError>

Lends the open pass, or the frame’s command encoder. A pass that a custom layer draws into has a color attachment.

Source§

fn read_texture( &mut self, texture: TextureId, region: TextureRegion, ) -> Result<ReadbackId, GpuError>

Copies into a buffer that is mapped once the copy is done: the last readback’s where it’s as big, else a new one.

Source§

fn take_readback( &mut self, readback: ReadbackId, wait: bool, ) -> Result<Option<Vec<u8>>, GpuError>

Polls the device for the map, or on a browser leaves it to the browser’s event loop, which can’t wait.

Source§

fn caps(&self) -> &Caps

Source§

fn create_buffer(&mut self, desc: &BufferDesc<'_>) -> Result<BufferId, GpuError>

Makes a buffer of desc, whose contents are undefined until written.
Source§

fn write_buffer( &mut self, buffer: BufferId, offset: u64, data: &[u8], ) -> Result<(), GpuError>

Writes data at offset bytes into buffer. offset and the length of data are multiples of 4.
Source§

fn create_texture( &mut self, desc: &TextureDesc<'_>, ) -> Result<TextureId, GpuError>

Makes a texture of desc. Fails as validation::check_mips does, and for a size or format the backend doesn’t make.
Source§

fn write_texture( &mut self, texture: TextureId, region: TextureRegion, data: &[u8], ) -> Result<(), GpuError>

Writes data, the region’s texels in rows from the top with no padding, to region of texture, which is sampled.
Source§

fn create_sampler(&mut self, state: SamplerState) -> Result<SamplerId, GpuError>

Source§

fn create_shader(&mut self, key: &ShaderKey) -> Result<ShaderId, GpuError>

Compiles the program of key. Fails with GpuError::Unsupported for a program the backend has no source for.
Source§

fn create_pipeline( &mut self, desc: &PipelineDesc<'_>, ) -> Result<PipelineId, GpuError>

Makes a pipeline of desc’s shader and state. Fails with GpuError::Unsupported for a primitive the backend doesn’t draw.
Source§

fn create_bindings( &mut self, desc: &BindingsDesc<'_>, ) -> Result<BindingsId, GpuError>

Makes the bindings of desc’s entries that its shader reads. Fails as validation::check_bindings does: for an entry of a buffer of another usage than Uniform or Storage, or Vertex where Caps::binds_vertex_buffers says, a range outside its buffer or at an offset the backend doesn’t align, a texture that isn’t sampled, two entries of one id, or a buffer or texture the shader reads and no entry binds.
Source§

fn create_geometry( &mut self, desc: &GeometryDesc<'_>, ) -> Result<GeometryId, GpuError>

Makes geometry of desc’s buffers. Fails as validation::check_geometry does: for a buffer of another usage than Vertex or the index buffer’s Index, an offset past a buffer’s end, or a buffer for each layout but not one.
Source§

fn begin_pass(&mut self, desc: &PassDesc<'_>) -> Result<(), GpuError>

Begins a pass over desc’s attachments, which are render targets of one size, a color one and a depth one, at least one of them. Fails while a pass is open.
Source§

fn draw(&mut self, draw: &Draw) -> Result<(), GpuError>

Draws draw into the open pass. Fails, drawing nothing, outside a pass, for a pipeline of other target formats than the pass’s attachments, for bindings or geometry made for another shader or vertex layouts than the pipeline’s, for indices or instances past the geometry’s buffers, and for a global index past the elements of the storage buffers the bindings bind. The contents of the indices are the caller’s to keep inside the vertex buffers.
Source§

fn end_pass(&mut self) -> Result<(), GpuError>

Ends the open pass, storing its attachments.
Source§

fn flush(&mut self, wait: bool) -> Result<(), GpuError>

Sends the work recorded so far to the GPU; with wait, then blocks until the GPU has finished it, on a backend that can block. Fails while a pass is open.
Source§

fn attaches_with_any_color(&self, _depth_stencil: TextureId) -> bool

Whether a pass can draw into depth_stencil, a depth attachment, together with any color attachment of its size. Not where it is an attachment of a framebuffer made elsewhere, such as a window surface’s, which a pass draws into only with that framebuffer’s color.

Auto Trait Implementations§

§

impl !RefUnwindSafe for WebGpu

§

impl !UnwindSafe for WebGpu

§

impl Forget for WebGpu

§

impl Freeze for WebGpu
where *const ArcInner<ContextWgpuCore> is !null: Freeze, PhantomData<ArcInner<ContextWgpuCore>>: Freeze, *const ArcInner<CoreAdapter> is !null: Freeze, PhantomData<ArcInner<CoreAdapter>>: Freeze, *const ArcInner<CoreDevice> is !null: Freeze, PhantomData<ArcInner<CoreDevice>>: Freeze, *const ArcInner<CoreQueue> is !null: Freeze, PhantomData<ArcInner<CoreQueue>>: Freeze, *const ArcInner<OnceLock<String>> is !null: Freeze, PhantomData<ArcInner<OnceLock<String>>>: Freeze, *const ArcInner<CoreBindGroupLayout> is !null: Freeze, PhantomData<ArcInner<CoreBindGroupLayout>>: Freeze, *const ArcInner<CoreBuffer> is !null: Freeze, PhantomData<ArcInner<CoreBuffer>>: Freeze, *const ArcInner<Mutex<MapContext>> is !null: Freeze, PhantomData<ArcInner<Mutex<MapContext>>>: Freeze, InternalBitFlags: Freeze, *const ArcInner<CoreBindGroup> is !null: Freeze, PhantomData<ArcInner<CoreBindGroup>>: Freeze, *const u8 is !null: Freeze, PhantomData<Slot<Buffer>>: Freeze, PhantomData<fn(DefaultKey) -> DefaultKey>: Freeze, PhantomData<fn(BufferId) -> BufferId>: Freeze, PhantomData<Chunk>: Freeze, *mut Counter<Channel<Chunk>>: Freeze, *mut Counter<Channel<Chunk>>: Freeze, *mut Counter<Channel<Chunk>>: Freeze, PhantomData<Copy>: Freeze, PhantomData<Slot<Texture>>: Freeze, PhantomData<fn(TextureId) -> TextureId>: Freeze, PhantomData<Slot<Sampler>>: Freeze, PhantomData<fn(SamplerId) -> SamplerId>: Freeze, PhantomData<Slot<Shader>>: Freeze, PhantomData<fn(ShaderId) -> ShaderId>: Freeze, PhantomData<(ShaderId, Vec<(Vec<VertexBufferLayout>, u32)>)>: Freeze, PhantomData<Slot<Pipeline>>: Freeze, PhantomData<fn(PipelineId) -> PipelineId>: Freeze, PhantomData<Slot<Bindings>>: Freeze, PhantomData<fn(BindingsId) -> BindingsId>: Freeze, PhantomData<Slot<Geometry>>: Freeze, PhantomData<fn(GeometryId) -> GeometryId>: Freeze, PhantomData<(ResourceId, u32)>: Freeze, PhantomData<(ResourceId, Vec<ResourceId>)>: Freeze, PhantomData<Slot<Readback>>: Freeze, PhantomData<fn(ReadbackId) -> ReadbackId>: Freeze, *const ArcInner<CoreComputePipeline> is !null: Freeze, PhantomData<ArcInner<CoreComputePipeline>>: Freeze, *const ArcInner<CoreShaderModule> is !null: Freeze, PhantomData<ArcInner<CoreShaderModule>>: Freeze, *const ArcInner<CoreSampler> is !null: Freeze, PhantomData<ArcInner<CoreSampler>>: Freeze, *const ArcInner<CorePipelineLayout> is !null: Freeze, PhantomData<ArcInner<CorePipelineLayout>>: Freeze, PhantomData<(TextureFormat, RenderPipeline)>: Freeze, *const ArcInner<Global> is !null: Freeze, PhantomData<ArcInner<Global>>: Freeze, NonZero<u64>: Freeze, PhantomData<CommandEncoder>: Freeze, *const ArcInner<Mutex<ErrorSinkRaw>> is !null: Freeze, PhantomData<ArcInner<Mutex<ErrorSinkRaw>>>: Freeze, *const ArcInner<Mutex<DeferredCommandBufferActions>> is !null: Freeze, PhantomData<ArcInner<Mutex<DeferredCommandBufferActions>>>: Freeze, PhantomData<u8>: Freeze, *const DeviceMismatch is !null: Freeze, PhantomData<DeviceMismatch>: Freeze, &'static str: Freeze, String: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, InternalBitFlags: Freeze, PhantomData<usize>: Freeze, PhantomData<Option<TextureFormat>>: Freeze, NonZero<u32>: Freeze, *const BinderError is !null: Freeze, PhantomData<BinderError>: Freeze, PhantomData<RenderCommand<ArcReferences>>: Freeze, PhantomData<u32>: Freeze, *const ArcInner<CommandEncoder> is !null: Freeze, PhantomData<ArcInner<CommandEncoder>>: Freeze, *const ArcInner<TextureView> is !null: Freeze, PhantomData<ArcInner<TextureView>>: Freeze, *const ArcInner<QuerySet> is !null: Freeze, PhantomData<ArcInner<QuerySet>>: Freeze, PhantomData<BindGroup>: Freeze, PhantomData<RenderPipeline>: Freeze, PhantomData<&'static ()>: Freeze, PhantomData<(BufferId, u64)>: Freeze, PhantomData<Option<BindingsId>>: Freeze,

§

impl Move for WebGpu

§

impl Send for WebGpu
where Arc<ContextWgpuCore>: Send, Arc<CoreAdapter>: Send, Arc<CoreDevice>: Send, Arc<CoreQueue>: Send, Arc<OnceLock<String>>: Send, Arc<CoreBindGroupLayout>: Send, Arc<CoreBuffer>: Send, Arc<Mutex<MapContext>>: Send, InternalBitFlags: Send, Arc<CoreBindGroup>: Send, RawVecInner: Send, Sender<Chunk>: Send, Receiver<Chunk>: Send, Arc<CoreTexture>: Send, &'static str: Send, InternalBitFlags: Send, &'static [TextureFormat]: Send, Arc<CoreTextureView>: Send, Arc<CoreSampler>: Send, Arc<CoreShaderModule>: Send, Arc<CorePipelineLayout>: Send, &'static Program: Send, InternalBitFlags: Send, RawTable<(ShaderId, Vec<(Vec<VertexBufferLayout>, u32)>)>: Send, Arc<CoreRenderPipeline>: Send, NonZero<u32>: Send, RawTable<(ResourceId, u32)>: Send, RawTable<(ResourceId, Vec<ResourceId>)>: Send, Arc<OnceLock<Result<(), BufferAsyncError>>>: Send, Arc<CoreComputePipeline>: Send, RawTable<(TextureFormat, RenderPipeline)>: Send, Arc<Global>: Send, NonZero<u64>: Send, Arc<Mutex<ErrorSinkRaw>>: Send, Arc<Mutex<DeferredCommandBufferActions>>: Send, BoxRaw<DeviceMismatch>: Send, String: Send, InternalBitFlags: Send, InternalBitFlags: Send, InternalBitFlags: Send, InternalBitFlags: Send, InternalBitFlags: Send, InternalBitFlags: Send, BoxRaw<BinderError>: Send, Arc<BindGroup>: Send, Arc<RenderPipeline>: Send, Arc<Buffer>: Send, Arc<QuerySet>: Send, Arc<RenderBundle>: Send, Arc<CommandEncoder>: Send, Arc<TextureView>: Send, &'static (): Send,

§

impl Sync for WebGpu
where Arc<ContextWgpuCore>: Sync, Arc<CoreAdapter>: Sync, Arc<CoreDevice>: Sync, Arc<CoreQueue>: Sync, Arc<OnceLock<String>>: Sync, Arc<CoreBindGroupLayout>: Sync, Arc<CoreBuffer>: Sync, Arc<Mutex<MapContext>>: Sync, InternalBitFlags: Sync, Arc<CoreBindGroup>: Sync, RawVecInner: Sync, Exclusive<Sender<Chunk>>: Sync, Exclusive<Receiver<Chunk>>: Sync, Arc<CoreTexture>: Sync, InternalBitFlags: Sync, Arc<CoreTextureView>: Sync, Arc<CoreSampler>: Sync, Arc<CoreShaderModule>: Sync, Arc<CorePipelineLayout>: Sync, InternalBitFlags: Sync, RawTable<(ShaderId, Vec<(Vec<VertexBufferLayout>, u32)>)>: Sync, Arc<CoreRenderPipeline>: Sync, NonZero<u32>: Sync, RawTable<(ResourceId, u32)>: Sync, RawTable<(ResourceId, Vec<ResourceId>)>: Sync, Arc<OnceLock<Result<(), BufferAsyncError>>>: Sync, Arc<CoreComputePipeline>: Sync, RawTable<(TextureFormat, RenderPipeline)>: Sync, Arc<Global>: Sync, NonZero<u64>: Sync, Arc<Mutex<ErrorSinkRaw>>: Sync, Arc<Mutex<DeferredCommandBufferActions>>: Sync, BoxRaw<DeviceMismatch>: Sync, String: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, BoxRaw<BinderError>: Sync, Arc<BindGroup>: Sync, Arc<RenderPipeline>: Sync, Arc<Buffer>: Sync, Arc<QuerySet>: Sync, Arc<RenderBundle>: Sync, Arc<CommandEncoder>: Sync, Arc<TextureView>: Sync,

§

impl Unpin for WebGpu
where Arc<ContextWgpuCore>: Unpin, Arc<CoreAdapter>: Unpin, Arc<CoreDevice>: Unpin, Arc<CoreQueue>: Unpin, Arc<OnceLock<String>>: Unpin, Arc<CoreBindGroupLayout>: Unpin, Arc<CoreBuffer>: Unpin, Arc<Mutex<MapContext>>: Unpin, InternalBitFlags: Unpin, Arc<CoreBindGroup>: Unpin, *const u8 is !null: Unpin, *mut Counter<Channel<Chunk>>: Unpin, *mut Counter<Channel<Chunk>>: Unpin, *mut Counter<Channel<Chunk>>: Unpin, Arc<CoreTexture>: Unpin, &'static str: Unpin, InternalBitFlags: Unpin, &'static [TextureFormat]: Unpin, Arc<CoreTextureView>: Unpin, Arc<CoreSampler>: Unpin, Arc<CoreShaderModule>: Unpin, Arc<CorePipelineLayout>: Unpin, &'static Program: Unpin, InternalBitFlags: Unpin, NonZero<u32>: Unpin, Arc<CoreRenderPipeline>: Unpin, Arc<OnceLock<Result<(), BufferAsyncError>>>: Unpin, Arc<CoreComputePipeline>: Unpin, Arc<Global>: Unpin, NonZero<u64>: Unpin, Arc<Mutex<ErrorSinkRaw>>: Unpin, Arc<Mutex<DeferredCommandBufferActions>>: Unpin, Box<DeviceMismatch>: Unpin, String: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, Box<BinderError>: Unpin, Arc<BindGroup>: Unpin, Arc<RenderPipeline>: Unpin, Arc<Buffer>: Unpin, Arc<QuerySet>: Unpin, Arc<RenderBundle>: Unpin, Arc<CommandEncoder>: Unpin, Arc<TextureView>: Unpin, &'static (): Unpin,

§

impl UnsafeUnpin for WebGpu
where *const ArcInner<ContextWgpuCore> is !null: UnsafeUnpin, PhantomData<ArcInner<ContextWgpuCore>>: UnsafeUnpin, *const ArcInner<CoreAdapter> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreAdapter>>: UnsafeUnpin, *const ArcInner<CoreDevice> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreDevice>>: UnsafeUnpin, *const ArcInner<CoreQueue> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreQueue>>: UnsafeUnpin, *const ArcInner<OnceLock<String>> is !null: UnsafeUnpin, PhantomData<ArcInner<OnceLock<String>>>: UnsafeUnpin, *const ArcInner<CoreBindGroupLayout> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreBindGroupLayout>>: UnsafeUnpin, *const ArcInner<CoreBuffer> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreBuffer>>: UnsafeUnpin, *const ArcInner<Mutex<MapContext>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<MapContext>>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, *const ArcInner<CoreBindGroup> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreBindGroup>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Slot<Buffer>>: UnsafeUnpin, PhantomData<fn(DefaultKey) -> DefaultKey>: UnsafeUnpin, PhantomData<fn(BufferId) -> BufferId>: UnsafeUnpin, PhantomData<Chunk>: UnsafeUnpin, *mut Counter<Channel<Chunk>>: UnsafeUnpin, *mut Counter<Channel<Chunk>>: UnsafeUnpin, *mut Counter<Channel<Chunk>>: UnsafeUnpin, PhantomData<Copy>: UnsafeUnpin, PhantomData<Slot<Texture>>: UnsafeUnpin, PhantomData<fn(TextureId) -> TextureId>: UnsafeUnpin, PhantomData<Slot<Sampler>>: UnsafeUnpin, PhantomData<fn(SamplerId) -> SamplerId>: UnsafeUnpin, PhantomData<Slot<Shader>>: UnsafeUnpin, PhantomData<fn(ShaderId) -> ShaderId>: UnsafeUnpin, PhantomData<(ShaderId, Vec<(Vec<VertexBufferLayout>, u32)>)>: UnsafeUnpin, PhantomData<Slot<Pipeline>>: UnsafeUnpin, PhantomData<fn(PipelineId) -> PipelineId>: UnsafeUnpin, PhantomData<Slot<Bindings>>: UnsafeUnpin, PhantomData<fn(BindingsId) -> BindingsId>: UnsafeUnpin, PhantomData<Slot<Geometry>>: UnsafeUnpin, PhantomData<fn(GeometryId) -> GeometryId>: UnsafeUnpin, PhantomData<(ResourceId, u32)>: UnsafeUnpin, PhantomData<(ResourceId, Vec<ResourceId>)>: UnsafeUnpin, PhantomData<Slot<Readback>>: UnsafeUnpin, PhantomData<fn(ReadbackId) -> ReadbackId>: UnsafeUnpin, *const ArcInner<CoreComputePipeline> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreComputePipeline>>: UnsafeUnpin, *const ArcInner<CoreShaderModule> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreShaderModule>>: UnsafeUnpin, *const ArcInner<CoreSampler> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreSampler>>: UnsafeUnpin, *const ArcInner<CorePipelineLayout> is !null: UnsafeUnpin, PhantomData<ArcInner<CorePipelineLayout>>: UnsafeUnpin, PhantomData<(TextureFormat, RenderPipeline)>: UnsafeUnpin, *const ArcInner<Global> is !null: UnsafeUnpin, PhantomData<ArcInner<Global>>: UnsafeUnpin, NonZeroU64Inner: UnsafeUnpin, PhantomData<CommandEncoder>: UnsafeUnpin, *const ArcInner<Mutex<ErrorSinkRaw>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<ErrorSinkRaw>>>: UnsafeUnpin, *const ArcInner<Mutex<DeferredCommandBufferActions>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<DeferredCommandBufferActions>>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const DeviceMismatch is !null: UnsafeUnpin, PhantomData<DeviceMismatch>: UnsafeUnpin, &'static str: UnsafeUnpin, String: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<Option<TextureFormat>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const BinderError is !null: UnsafeUnpin, PhantomData<BinderError>: UnsafeUnpin, PhantomData<RenderCommand<ArcReferences>>: UnsafeUnpin, PhantomData<u32>: UnsafeUnpin, *const ArcInner<CommandEncoder> is !null: UnsafeUnpin, PhantomData<ArcInner<CommandEncoder>>: UnsafeUnpin, *const ArcInner<TextureView> is !null: UnsafeUnpin, PhantomData<ArcInner<TextureView>>: UnsafeUnpin, *const ArcInner<QuerySet> is !null: UnsafeUnpin, PhantomData<ArcInner<QuerySet>>: UnsafeUnpin, PhantomData<BindGroup>: UnsafeUnpin, PhantomData<RenderPipeline>: UnsafeUnpin, PhantomData<&'static ()>: UnsafeUnpin, PhantomData<(BufferId, u64)>: UnsafeUnpin, PhantomData<Option<BindingsId>>: UnsafeUnpin,

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

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