quickjs-emscripten • quickjs-emscripten • Readme | Exports
quickjs-emscripten / quickjs-emscripten / StaticLifetime
A Lifetime that lives forever. Used for constants.
Lifetime
<T
,T
,Owner
>
• T
• Owner = never
new StaticLifetime<
T
,Owner
>(value
,owner
?):StaticLifetime
<T
,Owner
>
• value: T
• owner?: Owner
StaticLifetime
<T
, Owner
>
quickjs-emscripten.Lifetime.constructor
packages/quickjs-emscripten-core/src/lifetime.ts:198
protected
_alive:boolean
=true
quickjs-emscripten.Lifetime._alive
packages/quickjs-emscripten-core/src/lifetime.ts:72
protected
_constructorStack:undefined
|string
quickjs-emscripten.Lifetime._constructorStack
packages/quickjs-emscripten-core/src/lifetime.ts:73
protected
readonly
_owner?:Owner
quickjs-emscripten.Lifetime._owner
packages/quickjs-emscripten-core/src/lifetime.ts:87
protected
readonly
_value:T
quickjs-emscripten.Lifetime._value
packages/quickjs-emscripten-core/src/lifetime.ts:84
protected
readonly
copier?: (value
) =>T
• value: T
T
quickjs-emscripten.Lifetime.copier
packages/quickjs-emscripten-core/src/lifetime.ts:85
protected
readonly
disposer?: (value
) =>void
• value: T
void
quickjs-emscripten.Lifetime.disposer
packages/quickjs-emscripten-core/src/lifetime.ts:86
get
alive():boolean
boolean
true if the object is alive
false after the object has been disposed
packages/quickjs-emscripten-core/src/lifetime.ts:92
get
dupable():boolean
boolean
packages/quickjs-emscripten-core/src/lifetime.ts:203
get
owner():undefined
|Owner
undefined
| Owner
packages/quickjs-emscripten-core/src/lifetime.ts:107
get
value():T
The value this Lifetime protects. You must never retain the value - it may become invalid, leading to memory errors.
If the lifetime has been disposed already.
T
packages/quickjs-emscripten-core/src/lifetime.ts:102
[dispose]():
void
Just calls the standard .dispose() method of this class.
void
quickjs-emscripten.Lifetime.[dispose]
packages/quickjs-emscripten-core/src/lifetime.ts:47
consume<
O
>(map
):O
Call map
with this lifetime, then dispose the lifetime.
• O
• map: (lifetime
) => O
O
the result of map(this)
.
quickjs-emscripten.Lifetime.consume
packages/quickjs-emscripten-core/src/lifetime.ts:135
consume<
O
>(map
):O
• O
• map: (lifetime
) => O
O
quickjs-emscripten.Lifetime.consume
packages/quickjs-emscripten-core/src/lifetime.ts:138
dispose():
void
Dispose of value and perform cleanup.
void
quickjs-emscripten.Lifetime.dispose
packages/quickjs-emscripten-core/src/lifetime.ts:213
dup():
StaticLifetime
<T
,Owner
>
Create a new handle pointing to the same value.
StaticLifetime
<T
, Owner
>
quickjs-emscripten.Lifetime.dup
packages/quickjs-emscripten-core/src/lifetime.ts:208
map<
O
>(map
):O
Call map
with this lifetime, returning the result.
Does not dispose the lifetime.
• O
• map: (lifetime
) => O
O
the result of map(this)
.
quickjs-emscripten.Lifetime.map
packages/quickjs-emscripten-core/src/lifetime.ts:151
map<
O
>(map
):O
• O
• map: (lifetime
) => O
O
quickjs-emscripten.Lifetime.map
packages/quickjs-emscripten-core/src/lifetime.ts:152
tap(
fn
):StaticLifetime
<T
,Owner
>
Call fn
with this lifetime, then return this
. Does not dispose the
lifetime. Useful for imperative operations within an expression, like when
you're building up objects, or to add logging in the middle of a call chain.
• fn: (lifetime
) => void
StaticLifetime
<T
, Owner
>
this
quickjs-emscripten.Lifetime.tap
packages/quickjs-emscripten-core/src/lifetime.ts:164
tap(
fn
):QuickJSHandle
• fn: (lifetime
) => void
quickjs-emscripten.Lifetime.tap
packages/quickjs-emscripten-core/src/lifetime.ts:165
Generated using typedoc-plugin-markdown and TypeDoc