#memory-access #drop #read #read-write #by-value #owner #reading

guest

By-value memory storage without by-value memory access

3 unstable releases

0.2.0 Sep 9, 2024
0.1.1 Aug 7, 2024
0.1.0 Aug 6, 2024

#6 in #owner

Download history 212/week @ 2024-08-02 27/week @ 2024-08-09 1/week @ 2024-08-16 98/week @ 2024-09-06 50/week @ 2024-09-13 19/week @ 2024-09-20 12/week @ 2024-09-27 1/week @ 2024-10-04

145 downloads per month

MIT license

4KB
57 lines

Guest

By-value memory storage without by-value memory access.

Usage

Guests allow one to have reading and writing access whilst garunteeing that the memory is handed on to the next owner after usage.

Some example types are as follows:

  • Read access: Arc<Guest<T>>
  • Write access: Arc<Mutex<Guest<T>>>
  • Read and Write access: Arc<RwLock<Guest<T>>>

Some example callbacks could be:

  • Just dropping: std::mem::drop
  • Sending through a channel: move |last| sender.send(last).unwrap()
  • Setting a value: |last| capture = last

Dependencies

~1MB
~15K SLoC