lisette-stdlib 0.1.11

Little language inspired by Rust that compiles to Go
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
// Generated by Lisette bindgen
// Source: sync/atomic (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.11

/// AddInt32 atomically adds delta to *addr and returns the new value.
/// Consider using the more ergonomic and less error-prone [Int32.Add] instead.
pub fn AddInt32(addr: Ref<int32>, delta: int32) -> int32

/// AddInt64 atomically adds delta to *addr and returns the new value.
/// Consider using the more ergonomic and less error-prone [Int64.Add] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn AddInt64(addr: Ref<int64>, delta: int64) -> int64

/// AddUint32 atomically adds delta to *addr and returns the new value.
/// To subtract a signed positive constant value c from x, do AddUint32(&x, ^uint32(c-1)).
/// In particular, to decrement x, do AddUint32(&x, ^uint32(0)).
/// Consider using the more ergonomic and less error-prone [Uint32.Add] instead.
pub fn AddUint32(addr: Ref<uint32>, delta: uint32) -> uint32

/// AddUint64 atomically adds delta to *addr and returns the new value.
/// To subtract a signed positive constant value c from x, do AddUint64(&x, ^uint64(c-1)).
/// In particular, to decrement x, do AddUint64(&x, ^uint64(0)).
/// Consider using the more ergonomic and less error-prone [Uint64.Add] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn AddUint64(addr: Ref<uint64>, delta: uint64) -> uint64

/// AddUintptr atomically adds delta to *addr and returns the new value.
/// Consider using the more ergonomic and less error-prone [Uintptr.Add] instead.
pub fn AddUintptr(addr: Ref<uint>, delta: uint) -> uint

/// AndInt32 atomically performs a bitwise AND operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Int32.And] instead.
pub fn AndInt32(addr: Ref<int32>, mask: int32) -> int32

/// AndInt64 atomically performs a bitwise AND operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Int64.And] instead.
pub fn AndInt64(addr: Ref<int64>, mask: int64) -> int64

/// AndUint32 atomically performs a bitwise AND operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Uint32.And] instead.
pub fn AndUint32(addr: Ref<uint32>, mask: uint32) -> uint32

/// AndUint64 atomically performs a bitwise AND operation on *addr using the bitmask provided as mask
/// and returns the old.
/// Consider using the more ergonomic and less error-prone [Uint64.And] instead.
pub fn AndUint64(addr: Ref<uint64>, mask: uint64) -> uint64

/// AndUintptr atomically performs a bitwise AND operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Uintptr.And] instead.
pub fn AndUintptr(addr: Ref<uint>, mask: uint) -> uint

/// CompareAndSwapInt32 executes the compare-and-swap operation for an int32 value.
/// Consider using the more ergonomic and less error-prone [Int32.CompareAndSwap] instead.
pub fn CompareAndSwapInt32(addr: Ref<int32>, old: int32, new: int32) -> bool

/// CompareAndSwapInt64 executes the compare-and-swap operation for an int64 value.
/// Consider using the more ergonomic and less error-prone [Int64.CompareAndSwap] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn CompareAndSwapInt64(addr: Ref<int64>, old: int64, new: int64) -> bool

/// CompareAndSwapPointer executes the compare-and-swap operation for a unsafe.Pointer value.
/// Consider using the more ergonomic and less error-prone [Pointer.CompareAndSwap] instead.
pub fn CompareAndSwapPointer(addr: Ref<Unknown>, old: Unknown, new: Unknown) -> bool

/// CompareAndSwapUint32 executes the compare-and-swap operation for a uint32 value.
/// Consider using the more ergonomic and less error-prone [Uint32.CompareAndSwap] instead.
pub fn CompareAndSwapUint32(addr: Ref<uint32>, old: uint32, new: uint32) -> bool

/// CompareAndSwapUint64 executes the compare-and-swap operation for a uint64 value.
/// Consider using the more ergonomic and less error-prone [Uint64.CompareAndSwap] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn CompareAndSwapUint64(addr: Ref<uint64>, old: uint64, new: uint64) -> bool

/// CompareAndSwapUintptr executes the compare-and-swap operation for a uintptr value.
/// Consider using the more ergonomic and less error-prone [Uintptr.CompareAndSwap] instead.
pub fn CompareAndSwapUintptr(addr: Ref<uint>, old: uint, new: uint) -> bool

/// LoadInt32 atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Int32.Load] instead.
pub fn LoadInt32(addr: Ref<int32>) -> int32

/// LoadInt64 atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Int64.Load] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn LoadInt64(addr: Ref<int64>) -> int64

/// LoadPointer atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Pointer.Load] instead.
pub fn LoadPointer(addr: Ref<Unknown>) -> Unknown

/// LoadUint32 atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Uint32.Load] instead.
pub fn LoadUint32(addr: Ref<uint32>) -> uint32

/// LoadUint64 atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Uint64.Load] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn LoadUint64(addr: Ref<uint64>) -> uint64

/// LoadUintptr atomically loads *addr.
/// Consider using the more ergonomic and less error-prone [Uintptr.Load] instead.
pub fn LoadUintptr(addr: Ref<uint>) -> uint

/// OrInt32 atomically performs a bitwise OR operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Int32.Or] instead.
pub fn OrInt32(addr: Ref<int32>, mask: int32) -> int32

/// OrInt64 atomically performs a bitwise OR operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Int64.Or] instead.
pub fn OrInt64(addr: Ref<int64>, mask: int64) -> int64

/// OrUint32 atomically performs a bitwise OR operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Uint32.Or] instead.
pub fn OrUint32(addr: Ref<uint32>, mask: uint32) -> uint32

/// OrUint64 atomically performs a bitwise OR operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Uint64.Or] instead.
pub fn OrUint64(addr: Ref<uint64>, mask: uint64) -> uint64

/// OrUintptr atomically performs a bitwise OR operation on *addr using the bitmask provided as mask
/// and returns the old value.
/// Consider using the more ergonomic and less error-prone [Uintptr.Or] instead.
pub fn OrUintptr(addr: Ref<uint>, mask: uint) -> uint

/// StoreInt32 atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Int32.Store] instead.
pub fn StoreInt32(addr: Ref<int32>, val: int32)

/// StoreInt64 atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Int64.Store] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn StoreInt64(addr: Ref<int64>, val: int64)

/// StorePointer atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Pointer.Store] instead.
pub fn StorePointer(addr: Ref<Unknown>, val: Unknown)

/// StoreUint32 atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Uint32.Store] instead.
pub fn StoreUint32(addr: Ref<uint32>, val: uint32)

/// StoreUint64 atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Uint64.Store] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn StoreUint64(addr: Ref<uint64>, val: uint64)

/// StoreUintptr atomically stores val into *addr.
/// Consider using the more ergonomic and less error-prone [Uintptr.Store] instead.
pub fn StoreUintptr(addr: Ref<uint>, val: uint)

/// SwapInt32 atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Int32.Swap] instead.
pub fn SwapInt32(addr: Ref<int32>, new: int32) -> int32

/// SwapInt64 atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Int64.Swap] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn SwapInt64(addr: Ref<int64>, new: int64) -> int64

/// SwapPointer atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Pointer.Swap] instead.
pub fn SwapPointer(addr: Ref<Unknown>, new: Unknown) -> Unknown

/// SwapUint32 atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Uint32.Swap] instead.
pub fn SwapUint32(addr: Ref<uint32>, new: uint32) -> uint32

/// SwapUint64 atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Uint64.Swap] instead
/// (particularly if you target 32-bit platforms; see the bugs section).
pub fn SwapUint64(addr: Ref<uint64>, new: uint64) -> uint64

/// SwapUintptr atomically stores new into *addr and returns the previous *addr value.
/// Consider using the more ergonomic and less error-prone [Uintptr.Swap] instead.
pub fn SwapUintptr(addr: Ref<uint>, new: uint) -> uint

/// A Bool is an atomic boolean value.
/// The zero value is false.
/// 
/// Bool must not be copied after first use.
pub type Bool

/// An Int32 is an atomic int32. The zero value is zero.
/// 
/// Int32 must not be copied after first use.
pub type Int32

/// An Int64 is an atomic int64. The zero value is zero.
/// 
/// Int64 must not be copied after first use.
pub type Int64

/// A Pointer is an atomic pointer of type *T. The zero value is a nil *T.
/// 
/// Pointer must not be copied after first use.
pub type Pointer<T>

/// A Uint32 is an atomic uint32. The zero value is zero.
/// 
/// Uint32 must not be copied after first use.
pub type Uint32

/// A Uint64 is an atomic uint64. The zero value is zero.
/// 
/// Uint64 must not be copied after first use.
pub type Uint64

/// A Uintptr is an atomic uintptr. The zero value is zero.
/// 
/// Uintptr must not be copied after first use.
pub type Uintptr

/// A Value provides an atomic load and store of a consistently typed value.
/// The zero value for a Value returns nil from [Value.Load].
/// Once [Value.Store] has been called, a Value must not be copied.
/// 
/// A Value must not be copied after first use.
pub type Value

impl Bool {
  /// CompareAndSwap executes the compare-and-swap operation for the boolean value x.
  fn CompareAndSwap(self: Ref<Bool>, old: bool, new: bool) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Bool>) -> bool

  /// Store atomically stores val into x.
  fn Store(self: Ref<Bool>, val: bool)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Bool>, new: bool) -> bool
}

impl Int32 {
  /// Add atomically adds delta to x and returns the new value.
  fn Add(self: Ref<Int32>, delta: int32) -> int32

  /// And atomically performs a bitwise AND operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn And(self: Ref<Int32>, mask: int32) -> int32

  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Int32>, old: int32, new: int32) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Int32>) -> int32

  /// Or atomically performs a bitwise OR operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn Or(self: Ref<Int32>, mask: int32) -> int32

  /// Store atomically stores val into x.
  fn Store(self: Ref<Int32>, val: int32)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Int32>, new: int32) -> int32
}

impl Int64 {
  /// Add atomically adds delta to x and returns the new value.
  fn Add(self: Ref<Int64>, delta: int64) -> int64

  /// And atomically performs a bitwise AND operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn And(self: Ref<Int64>, mask: int64) -> int64

  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Int64>, old: int64, new: int64) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Int64>) -> int64

  /// Or atomically performs a bitwise OR operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn Or(self: Ref<Int64>, mask: int64) -> int64

  /// Store atomically stores val into x.
  fn Store(self: Ref<Int64>, val: int64)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Int64>, new: int64) -> int64
}

impl<T> Pointer<T> {
  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Pointer<T>>, old: Ref<T>, new: Ref<T>) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Pointer<T>>) -> Option<Ref<T>>

  /// Store atomically stores val into x.
  fn Store(self: Ref<Pointer<T>>, val: Ref<T>)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Pointer<T>>, new: Ref<T>) -> Option<Ref<T>>
}

impl Uint32 {
  /// Add atomically adds delta to x and returns the new value.
  fn Add(self: Ref<Uint32>, delta: uint32) -> uint32

  /// And atomically performs a bitwise AND operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn And(self: Ref<Uint32>, mask: uint32) -> uint32

  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Uint32>, old: uint32, new: uint32) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Uint32>) -> uint32

  /// Or atomically performs a bitwise OR operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn Or(self: Ref<Uint32>, mask: uint32) -> uint32

  /// Store atomically stores val into x.
  fn Store(self: Ref<Uint32>, val: uint32)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Uint32>, new: uint32) -> uint32
}

impl Uint64 {
  /// Add atomically adds delta to x and returns the new value.
  fn Add(self: Ref<Uint64>, delta: uint64) -> uint64

  /// And atomically performs a bitwise AND operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn And(self: Ref<Uint64>, mask: uint64) -> uint64

  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Uint64>, old: uint64, new: uint64) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Uint64>) -> uint64

  /// Or atomically performs a bitwise OR operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn Or(self: Ref<Uint64>, mask: uint64) -> uint64

  /// Store atomically stores val into x.
  fn Store(self: Ref<Uint64>, val: uint64)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Uint64>, new: uint64) -> uint64
}

impl Uintptr {
  /// Add atomically adds delta to x and returns the new value.
  fn Add(self: Ref<Uintptr>, delta: uint) -> uint

  /// And atomically performs a bitwise AND operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn And(self: Ref<Uintptr>, mask: uint) -> uint

  /// CompareAndSwap executes the compare-and-swap operation for x.
  fn CompareAndSwap(self: Ref<Uintptr>, old: uint, new: uint) -> bool

  /// Load atomically loads and returns the value stored in x.
  fn Load(self: Ref<Uintptr>) -> uint

  /// Or atomically performs a bitwise OR operation on x using the bitmask
  /// provided as mask and returns the old value.
  fn Or(self: Ref<Uintptr>, mask: uint) -> uint

  /// Store atomically stores val into x.
  fn Store(self: Ref<Uintptr>, val: uint)

  /// Swap atomically stores new into x and returns the previous value.
  fn Swap(self: Ref<Uintptr>, new: uint) -> uint
}

impl Value {
  /// CompareAndSwap executes the compare-and-swap operation for the [Value].
  /// 
  /// All calls to CompareAndSwap for a given Value must use values of the same
  /// concrete type. CompareAndSwap of an inconsistent type panics, as does
  /// CompareAndSwap(old, nil).
  fn CompareAndSwap(self: Ref<Value>, old: Unknown, new: Unknown) -> bool

  /// Load returns the value set by the most recent Store.
  /// It returns nil if there has been no call to Store for this Value.
  fn Load(self: Ref<Value>) -> Unknown

  /// Store sets the value of the [Value] v to val.
  /// All calls to Store for a given Value must use values of the same concrete type.
  /// Store of an inconsistent type panics, as does Store(nil).
  fn Store(self: Ref<Value>, val: Unknown)

  /// Swap stores new into Value and returns the previous value. It returns nil if
  /// the Value is empty.
  /// 
  /// All calls to Swap for a given Value must use values of the same concrete
  /// type. Swap of an inconsistent type panics, as does Swap(nil).
  fn Swap(self: Ref<Value>, new: Unknown) -> Unknown
}