Trait RegionLocalCopyExt
Source pub trait RegionLocalCopyExt<T>{
// Required method
fn get_local(&self) -> T;
}
Expand description
Extension trait that adds convenience methods to region-local static variables
in a region_local! block, specifically for Copy types.
Gets a copy of the value from the current memory region.
§Example
use region_local::{region_local, RegionLocalCopyExt};
region_local!(static CURRENT_ACCESS_TOKEN: u128 = 0x123100);
let token = CURRENT_ACCESS_TOKEN.get_local();
assert_eq!(token, 0x123100);