Skip to main content

Stream

Struct Stream 

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

A shared CUDA stream retaining its actual context.

Clones share native ownership and capture cleanup. Owned handles are synchronized and destroyed when their last wrapper drops. Externally owned handles instead retain an ownership token and are not destroyed by this wrapper.

Implementations§

Source§

impl Stream

Source

pub fn completion(&self) -> Result<CheckedStreamFuture>

Returns a future that resolves with CUDA’s status once the work queued so far on this stream completes.

An event wait observes CUDA status independently of notification callbacks. Registration is rejected while stream capture is active.

§Errors

Returns an error if capture is active or invalidated, CUDA cannot query capture state, create or record the completion event, or bind the context, or the completion worker cannot be started or accept work. The returned future reports asynchronous CUDA completion errors.

Source§

impl Stream

Source

pub fn capture_owned<O: Recordable>( &self, operation: O, ) -> Result<OwnedGraph<O::Output>>

Captures already prepared owned work; no producer executes during recording.

§Errors

Propagates capture setup, operation recording, and capture finalization errors. Resources registered before failure remain retained until capture ends; if cleanup cannot establish that capture ended, the recording preserves those resources.

Source§

impl Stream

Source

pub unsafe fn from_cudarc(owner: Arc<CudaStream>) -> Result<Self>

Borrows a cudarc stream and retains its native stream and context owners.

§Safety

Coordinate external submissions with Singe access tracking and capture lifecycle.

§Errors

Returns an error if the stream is a per-thread default stream or its context cannot be retained or bound.

Source

pub unsafe fn to_cudarc( &self, context: &Arc<CudaContext>, ) -> Result<Arc<CudaStream>>

Exposes this stream to cudarc without transferring destruction responsibility.

§Safety

Retain this Singe stream while any returned cudarc clone or allocation uses it. Cudarc submissions must participate in explicit ordering and exclude conflicting Singe accesses.

§Errors

Returns an error if context is not this stream’s context.

Source§

impl Stream

Source

pub fn add_callback<F>(&self, callback: F) -> Result<()>
where F: FnOnce(Result<()>) + Send + 'static,

This callback API is slated for eventual deprecation and removal. If you do not require the callback to execute after a device error, consider using sys::cudaLaunchHostFunc. Additionally, this callback mechanism is not supported with Stream::begin_capture and Stream::end_capture, unlike sys::cudaLaunchHostFunc.

Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each Stream::add_callback call, a callback is executed exactly once. A panic in the callback is caught and reported on standard error. The callback blocks later work in the stream until it is finished.

The callback may be passed a successful status or an error code. In the event of a device error, all subsequently executed callbacks receive an appropriate Status.

Callbacks must not call CUDA functions. Attempting to do so may result in crate::error::Status::NotPermitted. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized.

For the purposes of Unified Memory, callback execution makes a number of guarantees:

  • The callback stream is considered idle for the duration of the callback. Thus, for example, a callback may always use memory attached to the callback stream.
  • The start of execution of a callback has the same effect as synchronizing an event recorded in the same stream immediately before the callback. It thus synchronizes streams which have been “joined” before the callback.
  • Adding device work to any stream does not have the effect of making the stream active until all preceding callbacks have executed. Thus, for example, a callback might use global attached memory even if work has been added to another stream, if it has been properly ordered with an event.
  • Completion of a callback does not cause a stream to become active except as described above. The callback stream will remain idle if no device work follows the callback, and will remain idle across consecutive callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a callback at the end of the stream.
§Errors

Returns an error if the context cannot be bound, CUDA rejects the callback registration, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics such as crate::error::Status::NotInitialized, crate::error::Status::CallRequiresNewerDriver, or crate::error::Status::NoDevice.

Source

pub fn launch_host_func<F>(&self, function: F) -> Result<()>
where F: FnOnce() + Send + 'static,

Enqueues a host function to run after all currently enqueued work in this stream completes.

Unlike Stream::add_callback, CUDA does not call this function if the CUDA context is already in an error state, and then drops neither it nor its captures. The host function must not call CUDA APIs or perform synchronization that depends on outstanding device work. A panic in the host function is caught and reported on standard error.

§Errors

Returns an error if the stream is capturing, since a graph would run the FnOnce function on every replay. Also returns an error if the context cannot be bound, CUDA rejects the host function registration, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.

Source§

impl Stream

Source

pub fn begin_capture(&self, mode: StreamCaptureMode) -> Result<()>

Begin graph capture on stream. When a stream is in capture mode, operations pushed into the stream are captured into a graph instead of executed. Stream::end_capture returns the graph. Capture may not be initiated on the legacy default stream. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via Stream::capture_status. A unique id representing the capture sequence may be queried via Stream::capture_info.

If mode is not StreamCaptureMode::Relaxed, Stream::end_capture must be called on this stream from the same thread.

Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.

§Errors

Returns an error if the context cannot be bound, capture cannot begin on this stream, the capture mode is invalid for the current thread state, or a previous asynchronous launch reports an error.

Source

pub unsafe fn begin_capture_to_graph( &self, graph: &Graph, dependencies: &[GraphDependency], mode: StreamCaptureMode, ) -> Result<()>

Begin graph capture on stream. When a stream is in capture mode, operations pushed into the stream are captured into a graph instead of executed. Stream::end_capture returns the graph.

Capture may not be initiated on the legacy default stream. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via Stream::capture_status. A unique id representing the capture sequence may be queried via Stream::capture_info.

If mode is not StreamCaptureMode::Relaxed, Stream::end_capture must be called on this stream from the same thread.

Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.

§Safety

This captures into graph’s existing CUDA handle. Calling Stream::end_capture after this may return that same raw handle; the caller must not wrap it as a second owned Graph.

§Errors

Returns an error if the context cannot be bound, capture cannot begin on this stream, the graph dependencies are invalid, the capture mode is invalid for the current thread state, or a previous asynchronous launch reports an error.

Source

pub fn end_capture(&self) -> Result<Graph>

Ends capture on this stream, returning the captured graph. Capture must have been initiated on stream via a call to Stream::begin_capture. If capture was invalidated due to a violation of the rules of stream capture, an error is returned.

If the mode argument to Stream::begin_capture was not StreamCaptureMode::Relaxed, this call must be from the same thread as Stream::begin_capture.

§Errors

Returns an error if the context cannot be bound, capture is not active on this stream, the capture has been invalidated, or a previous asynchronous launch reports an error.

Source

pub fn capture<F>(&self, mode: StreamCaptureMode, f: F) -> Result<Graph>
where F: FnOnce(&StreamCaptureScope<'_>) -> Result<()>,

Captures stream work recorded by f into a CUDA graph.

This is the scoped form of Stream::begin_capture and Stream::end_capture. This method attempts to end capture before it returns or resumes a panic. If f returns an error, this method attempts to end capture to restore stream usability, destroys any graph returned by CUDA, and returns the closure error.

The scope is !Send, so it cannot move to another thread while capture is active. It retains recorded kernel-code owners in the returned graph.

§Errors

Returns an error if capture cannot begin, if f returns an error, or if capture cannot be ended successfully.

Source

pub fn capture_executable<F>( &self, mode: StreamCaptureMode, flags: GraphInstantiateFlags, f: F, ) -> Result<ExecutableGraph>
where F: FnOnce(&StreamCaptureScope<'_>) -> Result<()>,

Captures work recorded by f and instantiates the resulting graph with flags.

Recorded kernel-code owners are retained by the executable.

§Errors

Propagates capture setup, closure, capture finalization, and graph-instantiation errors, including unsupported flags or invalid captured nodes.

Source

pub fn capture_status(&self) -> Result<StreamCaptureStatus>

Returns the capture status of this stream. After a successful call, the status is one of the following:

If this is called on the legacy default stream while a blocking stream on the same device is capturing, it returns crate::error::Status::StreamCaptureImplicit. The blocking stream capture is not invalidated.

When a blocking stream is capturing, the legacy stream is in an unusable state until the blocking stream capture is terminated. The legacy stream is not supported for stream capture, but attempted use would have an implicit dependency on the capturing stream(s).

§Errors

Returns an error if the context cannot be bound, CUDA cannot query the capture status, or a previous asynchronous launch reports an error.

Source

pub fn capture_info(&self) -> Result<StreamCaptureInfo>

Query stream state related to stream capture.

If called on the legacy default stream while a stream not created with StreamFlags::NON_BLOCKING is capturing, returns crate::error::Status::StreamCaptureImplicit.

Valid data (other than capture status) is returned only if both of the following are true:

If there is non-zero edge data for one or more current stream dependencies and the query cannot return that data, the call returns crate::error::Status::LossyQuery.

§Errors

Returns an error if the context cannot be bound, CUDA cannot query the capture info, the query would lose non-zero edge data, or a previous asynchronous launch reports an error.

Source

pub fn update_capture_dependencies( &self, dependencies: &[GraphDependency], mode: StreamCaptureDependencyUpdate, ) -> Result<()>

Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the stream will depend on.

mode is StreamCaptureDependencyUpdate::Add to add the supplied set to the existing set, or StreamCaptureDependencyUpdate::Set to replace it.

Nodes that are removed from the dependency set by this call do not result in crate::error::Status::StreamCaptureUnjoined if they are unreachable from the stream at Stream::end_capture.

Returns crate::error::Status::IllegalState if the stream is not capturing.

§Errors

Returns an error if the context cannot be bound, the stream is not capturing, the supplied dependencies are invalid, or a previous asynchronous launch reports an error.

Source§

impl Stream

Source

pub fn ensure_not_capturing(&self) -> Result<()>

Rejects active or invalidated capture before an operation that cannot be recorded.

Call this before synchronous work or ordinary allocation so a rejected operation does not first change the capturing stream’s state.

§Errors

Returns the native stream-capture-unsupported status for active capture or the stream-capture-invalidated status for invalidated capture. Also propagates capture-state query and context binding errors.

Source§

impl Stream

Source

pub unsafe fn from_raw(raw: RawStream) -> Result<Self>

Adopts a raw stream with the release responsibility recorded in raw.ownership.

An owned handle is synchronized and destroyed when the last clone drops; a borrowed handle keeps its owner token instead. Use Stream::shutdown to surface synchronization or destruction errors explicitly.

§Safety

raw.handle must be a valid CUDA stream of raw.context. An owned handle must not be destroyed elsewhere; a borrowed handle must stay valid while its owner token lives.

§Errors

Returns Error::NullHandle if raw.handle is null.

Source

pub unsafe fn borrow_with_owner( handle: cudaStream_t, context: Arc<Context>, owner: Arc<dyn Any + Send + Sync>, ) -> Result<Self>

Borrows a stream while retaining the library object that owns its native handle. Default legacy streams are accepted; per-thread default streams cannot be shared across threads.

§Safety

The handle must belong to context and remain valid while owner is retained. External work must obey this wrapper’s access ordering and capture lifecycle.

§Errors

Returns Error::ThreadLocalStreamUnsupported for the per-thread default-stream sentinel. Also propagates context binding errors. Other handle validity and external ownership requirements remain the caller’s responsibility.

Source§

impl Stream

Source

pub fn into_raw(self) -> StdResult<RawStream, Self>

Transfers the native handle, context and destruction responsibility to the caller. Destroy owned handles explicitly; retain borrowed ownership tokens through every use. Returns the unchanged stream if another clone or pending capture cleanup still retains it.

§Errors

Returns Err(self) if another stream clone retains the wrapper or shared capture cleanup still holds deferred owners, frees, or foreign tokens. The returned wrapper remains usable and retains its release responsibility.

Source§

impl Stream

Source

pub fn sync_scope<'env, F, R>(&self, f: F) -> Result<R>
where F: for<'scope> FnOnce(&'scope StreamScope<'scope, 'env>) -> Result<R>,

Runs f with a stream scope and synchronizes this stream before returning.

Use this for scoped asynchronous operations that borrow host or device memory until stream completion. For CUDA graph capture, use Stream::capture or Stream::capture_executable. The completion wait also runs when f unwinds. If CUDA completion cannot be established, the process aborts before returning borrowed storage to the caller.

§Errors

Propagates capture-state query errors, rejects active or invalidated capture, and returns errors from f or stream synchronization. If both f and synchronization fail and cleanup can drain the stream, the closure error takes precedence.

Source

pub fn complete<R, E>( &self, f: impl FnOnce() -> StdResult<R, E>, ) -> StdResult<R, E>
where E: From<Error>,

Runs f, then waits for this stream even when f fails or unwinds, so borrowed operands outlive the work f enqueues.

Capture is rejected before f runs. This is StreamBinding::sync_scope on a borrowed binding of this stream.

§Errors

Converts capture-query, context binding, capture rejection, and stream synchronization errors into E. Errors returned by f take precedence over a synchronization error.

Source§

impl Stream

Source

pub unsafe fn memory_operations( &self, operations: &[MemoryOperation], ) -> Result<()>

Enqueues an ordered batch of at most 255 memory operations.

§Safety

Addresses must be live, naturally aligned, non-managed memory accessible in this context. Keep storage live and exclude conflicting accesses until completion or every captured replay. Waits must be satisfiable without circular dependencies, with event ordering visible to CUDA.

§Errors

Returns Error::OutOfRange for 256 or more operations, Error::NullPointer for a null wait or write address, or Error::Misaligned for a misaligned one. Also propagates context binding and native batch errors, including unsupported operations or device capabilities. An empty batch succeeds without binding the context or calling CUDA.

Source§

impl Stream

Source

pub unsafe fn wait_value32( &self, address: DevicePtr, value: u32, condition: WaitCondition, flags: WaitFlags, ) -> Result<()>

Waits for a naturally aligned device word to satisfy the condition.

§Safety

Follow Stream::memory_operations’s storage, ordering and progress requirements.

§Errors

Returns Error::NullPointer for a null address, or Error::Misaligned for one not aligned to the native word size. Also propagates context binding and native wait errors for unsupported conditions, flags, or device capabilities.

Source

pub unsafe fn write_value32(&self, address: DevicePtr, value: u32) -> Result<()>

Writes a naturally aligned device word with the native stream memory fence.

§Safety

Follow Stream::memory_operations’s storage and ordering requirements.

§Errors

Returns Error::NullPointer for a null address, or Error::Misaligned for one not aligned to the native word size. Also propagates context binding and native write errors, including unsupported memory operations on the device.

Source§

impl Stream

Source

pub unsafe fn wait_value64( &self, address: DevicePtr, value: u64, condition: WaitCondition, flags: WaitFlags, ) -> Result<()>

Waits for a naturally aligned device word to satisfy the condition.

§Safety

Follow Stream::memory_operations’s storage, ordering and progress requirements.

§Errors

Returns Error::NullPointer for a null address, or Error::Misaligned for one not aligned to the native word size. Also propagates context binding and native wait errors for unsupported conditions, flags, or device capabilities.

Source

pub unsafe fn write_value64(&self, address: DevicePtr, value: u64) -> Result<()>

Writes a naturally aligned device word with the native stream memory fence.

§Safety

Follow Stream::memory_operations’s storage and ordering requirements.

§Errors

Returns Error::NullPointer for a null address, or Error::Misaligned for one not aligned to the native word size. Also propagates context binding and native write errors, including unsupported memory operations on the device.

Source§

impl Stream

Source

pub fn defer_drop_until_capture_end<T>(&self, owner: Arc<T>) -> Result<()>
where T: Debug + Send + Sync + 'static,

Defers destruction of an unused resource until capture ends, if active. This permits eager APIs to reject capture without calling a capture-incompatible destructor while releasing their arguments. It does not retain resources for graph replay. End capture through this stream wrapper to release these owners. Avoid owners that retain this stream, which would create a reference cycle.

§Errors

Propagates capture-state query and context binding errors. If capture is inactive, owner is dropped before this call returns.

Source

pub fn to_borrowed(&self) -> BorrowedStream

Returns a borrowed stream wrapper retaining a clone of this stream’s owner.

Source

pub unsafe fn to_unretained(&self) -> BorrowedStream

Returns a borrowed stream wrapper that does not retain this stream’s owner.

A native owner passed to Self::defer_drop_until_capture_end holds one, since retaining the stream would form a reference cycle.

§Safety

The returned wrapper must not be used after the last owner of this stream is dropped.

Source

pub fn synchronize(&self) -> Result<()>

Blocks until stream has completed all operations. If ContextFlags::SCHEDULE_BLOCKING_SYNC was set for this device, the host thread will block until the stream is finished with all of its tasks.

Uses standard default stream semantics.

§Errors

Returns an error if stream synchronization fails or if a previous asynchronous launch reported an error. CUDA may also return initialization-related errors such as crate::error::Status::NotInitialized, crate::error::Status::CallRequiresNewerDriver, or crate::error::Status::NoDevice if this call initializes internal runtime state. Callbacks must not call CUDA functions; see Stream::add_callback.

Source

pub fn synchronize_or_abort(&self)

Waits for queued work on this stream, or prints the error and aborts the process if the wait fails.

Cleanup code calls this before releasing borrowed storage that queued work may still access.

Source

pub fn shutdown(self) -> Result<()>

Synchronizes this stream and releases its native ownership.

Owned handles are destroyed. Borrowed handles release their external owner token after synchronization instead of destroying the handle. This may block while waiting for stream work and callbacks. For owned handles, destruction is attempted even if synchronization fails, and the synchronization error takes precedence over a destruction error.

§Errors

Returns Error::OwnershipShared if another stream clone or borrowed owner still retains the handle. Also propagates capture-state rejection, deferred-free enqueue, context binding, synchronization, or owned-handle destruction errors. Synchronization errors take precedence over destruction errors.

Source

pub fn query(&self) -> Result<bool>

Returns true if all operations in stream have completed, or false if not.

For the purposes of Unified Memory, a return value of true is equivalent to having called Stream::synchronize.

Uses standard default stream semantics.

§Errors

Returns an error if querying the stream fails or if a previous asynchronous launch reported an error. CUDA may also return initialization-related errors such as crate::error::Status::NotInitialized, crate::error::Status::CallRequiresNewerDriver, or crate::error::Status::NoDevice if this call initializes internal runtime state. Callbacks must not call CUDA functions; see Stream::add_callback.

Source

pub fn wait_event(&self, event: &Event, flags: EventWaitFlags) -> Result<()>

Makes all future work submitted to stream wait for all work captured in event. See sys::cudaEventRecord for details on what is captured by an event. flags controls how strictly the wait is enforced during capture. Synchronization is performed efficiently on the device when applicable. event may be from a different device than stream.

§Errors

Returns an error if the stream cannot wait on the event or if a previous asynchronous launch reported an error.

Source

pub fn fork(&self) -> Result<Self>

Creates a nonblocking stream ordered after this stream’s current work.

The new stream uses this stream’s context and priority. Later submissions to either stream can execute independently. Call Stream::join to order subsequent work after a branch completes. During capture, keep the branch alive until capture ends and join it back into the capturing stream before ending capture.

§Errors

Returns an error if CUDA cannot create the stream or establish its event dependency.

Source

pub fn join(&self, other: &Self) -> Result<()>

Orders subsequent work on this stream after the other stream’s current work.

Records an event on other and enqueues a wait on this stream without blocking the host. The other stream may belong to a different CUDA context or device. Work submitted to other after this call is independent of the dependency.

§Errors

Returns an error if CUDA cannot record the event or enqueue the wait.

Source

pub fn join_regions(&self, regions: &[DeviceRegion<'_>]) -> Result<()>

Orders subsequent work after the readiness streams of these device regions.

All regions must belong to this stream’s context. Each distinct producer stream contributes one event dependency. This does not establish initialization or retain allocations for later work. Borrowed consumers must keep their resources in a draining scope; raw queued consumers must uphold their resource and access contracts.

§Errors

Returns Error::MemoryContextMismatch before submitting dependencies if any region belongs to another context, or a CUDA error if an event cannot be recorded or waited on.

Source

pub fn flags(&self) -> Result<StreamFlags>

Query the flags of a stream. Returns the stream flags. See StreamFlags for the valid flags.

Uses standard default stream semantics.

§Errors

Returns an error if CUDA cannot query the flags or if a previous asynchronous launch reported an error. CUDA may also return initialization-related errors such as crate::error::Status::NotInitialized, crate::error::Status::CallRequiresNewerDriver, or crate::error::Status::NoDevice if this call initializes internal runtime state. Callbacks must not call CUDA functions; see Stream::add_callback.

Source

pub fn priority(&self) -> Result<i32>

Query the priority of a stream. Returns the stream priority. If the stream was created with a priority outside the meaningful numerical range returned by Device::stream_priority_range, this returns the clamped priority. See StreamOptions::priority for details about priority clamping.

§Errors

Returns an error if the context cannot be bound, CUDA cannot query the priority, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.

Source

pub fn id(&self) -> Result<u64>

Returns a stream identifier that remains unique for the life of the program.

The stream handle may refer to any of the following:

§Errors

Returns an error if the context cannot be bound, CUDA cannot query the stream identifier, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.

Source

pub fn device(&self) -> Result<Device>

Returns the device of the stream.

§Errors

Returns an error if the context cannot be bound, CUDA cannot query the stream device, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.

Source

pub fn context(&self) -> &Arc<Context> ⓘ

Returns the context retained by this stream.

Source

pub fn as_raw(&self) -> cudaStream_t

Returns the borrowed native stream handle without transferring ownership.

Source§

impl Stream

Source

pub fn submit<O: Operation>( &self, operation: O, ) -> Result<Submission<O::Output, O::Pending>>

Submits owned work with independent resource retention and checked completion.

§Errors

Propagates errors from the operation’s Operation::submit_on implementation, including execution setup, enqueue, and completion registration failures. An error can occur after some native work has been queued; the execution ledger retains its resources through cleanup.

Source§

impl Stream

Source

pub unsafe fn enqueue_async<T, F>( &self, resources: Resources, enqueue: F, ) -> Result<Submission<T>>
where F: FnOnce(&Self) -> Result<T>,

Submits arbitrary raw work with an explicitly supplied ownership ledger.

§Safety

The resources must retain every native owner and declare all accesses before enqueue runs. Follow crate::submission::Execution::enqueue’s native execution contract.

§Errors

Propagates capture-state, context, access-tracking, dependency-ordering, and completion-event errors, errors returned by enqueue, and failures to start or submit to the completion worker. The callback may already have enqueued work when a later step fails.

Trait Implementations§

Source§

impl AsStream for Stream

Source§

fn context(&self) -> &Arc<Context> ⓘ

Returns the context the stream belongs to.
Source§

fn as_raw(&self) -> cudaStream_t

Returns the native stream handle without transferring ownership.
Source§

fn synchronize(&self) -> Result<()>

Blocks until the stream has completed all queued work. Read more
Source§

fn synchronize_or_abort(&self)

Waits for queued work on the stream, or prints the error and aborts the process if the wait fails. Read more
Source§

fn capture_status(&self) -> Result<StreamCaptureStatus>

Reports the stream’s capture state without invalidating an active capture. Read more
Source§

fn ensure_not_capturing(&self) -> Result<()>

Rejects active or invalidated capture before an operation that cannot be recorded. Read more
Source§

fn wait_event(&self, event: &Event, flags: EventWaitFlags) -> Result<()>

Makes work submitted to the stream after this call wait for the work captured in event. Read more
Source§

fn join_regions(&self, regions: &[DeviceRegion<'_>]) -> Result<()>

Orders subsequent work on the stream after the readiness streams of these device regions. Read more
Source§

impl Clone for Stream

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Stream

Source§

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

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

impl Eq for Stream

Source§

impl Hash for Stream

Source§

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

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 PartialEq for Stream

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Stream

§

impl !UnwindSafe for Stream

§

impl Forget for Stream

§

impl Freeze for Stream

§

impl Move for Stream

§

impl Send for Stream

§

impl Sync for Stream

§

impl Unpin for Stream

§

impl UnsafeUnpin for Stream

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> 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.