buyergugl.blogg.se

Pin stacks
Pin stacks









pin stacks

pin stacks

This is necessary to enforce the "drop will be run" guarantee.Īdditionally, the stackpin crate promotes an idiom where "unmovable" types are strictly

pin stacks

The pin-utils crate also providesĪ type T that wants to benefit from the guarantees provided by StackPinned should be

  • The stackpin crate solely focuses on stack pinning.
  • The StackPinned type expresses strong guarantee about the fact that the destructor for.
  • stackpin aims at promoting a model whereĪll unmovable types are only accessible once pinned.
  • The provided FromUnpinned trait and Unpinned struct aim at separating unmovable typesįrom the data that can be used to construct them.
  • The syntax for the stack_let! ( mut id : ty = expr ) macro attempts to mimic a regular let mut id : ty = expr statement.
  • The only handle to T, and not a reborrowed reference. "root handle" semantics that guarantees that a function consuming a PinStack consumes With a "mutable reference" semantics that includes reborrow.
  • pin-utils provides a macro to return a Pin instance,.
  • This crate was inspired from the pin-utils crate, the main differences being: The crate also exposes the PinStack type alias for Pin >. The crate exposes a trait, FromUnpinned, as well as a stack_let macro that makes safely creating StackPinned instances easier. The stackpin crate exposes a StackPinned type that allows to represent !Unpin data that should be pinned to the stack See the crate documentation for details, or look directly at the examples. Getting instances pinned at the point of declaration is as easy as: stack_let! (unmovable = Unmovable ::new_unpinned ( "Intel the Beagle " ) ) // this creates the unmovable instance on the stack and binds `unmovable` with a `PinStack`įor Unmovable a struct implementing the FromUnpinned trait. To do so, this crate provides a FromUnpinned trait and a stack_let! macro that enable safe construction of Pin objects (aliased to PinStack for short). This crate exposes a StackPinned type that allows to represent !Unpin data that should be pinned to the stack at the point of declaration.

    PIN STACKS DOWNLOAD

    # 820 in Rust patterns Download history 6/week 4/week 5/week 14/week 2/week 7/week 5/week 6/week 4/week 22/week 17/week 36/week 14/week 10/week 24/week 4/week











    Pin stacks