Conceptual
Login

The Drop Trait

Drop::drop runs automatically when a value's owner goes out of scope, in reverse declaration order, giving Rust deterministic RAII cleanup for memory, files, locks, and sockets. You cannot call drop() explicitly; std::mem::drop moves the value to force early cleanup.

This Concept is waiting for its first lesson!

Drop::drop runs automatically when a value's owner goes out of scope, in reverse declaration order, giving Rust deterministic RAII cleanup for memory, files, locks, and sockets. You cannot call drop() explicitly; std::mem::drop moves the value to force early cleanup.

Are you a teacher? Sign in to start contributing.

Sign In