Module Scoped.SharedSource
Source
type ('a, 'k) inner = #{data : ('a Basement.Modes.shared, 'k) Data.t;password : 'k Capsule_prim__.Prim.Password.Shared.t;
}An encapsulated value that may be read for the duration of the current region.
A value of type 'a Scoped.Shared.t provides shared access to the underlying 'a over a local scope. A forkable 'a Scoped.Shared.t can be captured by functions that run from other capsules.
Source
val with_ :
('a : value mod portable) 'b. 'a @ shared ->
f:('a t @ local forkable -> 'b) @ local once forkable ->
'bwith_ a ~f calls f with a local forkable Shared.t representing local read-only access to a, which is readable in the current capsule.
Source
val get :
('a : value mod portable) 'b. 'a t @ local ->
f:('a @ shared -> 'b @ portable contended) @ local once portable ->
'b @ portable contendedget t ~f computes a value using data accessible via t.
Source
val iter :
('a : value mod portable). 'a t @ local ->
f:('a @ shared -> unit) @ local once portable ->
unitLike get, but for for functions that return unit.
Source
val map :
('a : value mod portable) ('b : value mod portable). 'a t @ local ->
f:('a @ shared -> 'b @ shared) @ local once portable ->
'b t @ localConstruct a new t by mapping a function over the referenced value.