Module
Defined in: src/module.ts:142
Implements
Section titled “Implements”AsyncDisposable
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Module(
init):Module
Defined in: src/module.ts:190
Note this only sets the module up. Use init to actually load it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Module
Properties
Section titled “Properties”_exit?
Section titled “_exit?”
protectedreadonlyoptional_exit?: (this) =>void|Promise<void>
Defined in: src/module.ts:151
Parameters
Section titled “Parameters”Module
Returns
Section titled “Returns”void | Promise<void>
_init?
Section titled “_init?”
protectedreadonlyoptional_init?: (this) =>void|Promise<void>
Defined in: src/module.ts:150
Parameters
Section titled “Parameters”Module
Returns
Section titled “Returns”void | Promise<void>
_refs:
number=0
Defined in: src/module.ts:180
Internal
The number of references held on this module.
author?
Section titled “author?”
readonlyoptionalauthor?:string|string[]
Defined in: src/module.ts:148
description?
Section titled “description?”
readonlyoptionaldescription?:string
Defined in: src/module.ts:147
holders
Section titled “holders”
readonlyholders:Set<Module>
Defined in: src/module.ts:172
Modules that depend on this one
kobject
Section titled “kobject”
readonlykobject:ModuleKObject
Defined in: src/module.ts:164
license?
Section titled “license?”
readonlyoptionallicense?:string
Defined in: src/module.ts:146
readonlyname:string
Defined in: src/module.ts:143
params
Section titled “params”
readonlyparams:Map<string,KernelParam<ParamValue>>
Defined in: src/module.ts:166
srcversion?
Section titled “srcversion?”
readonlyoptionalsrcversion?:string
Defined in: src/module.ts:145
taints
Section titled “taints”
readonlytaints:Set<"P"|"F"|"C"|"E"|"O">
Defined in: src/module.ts:174
readonlyuses:Set<Module>
Defined in: src/module.ts:169
Modules this one depends on
version?
Section titled “version?”
readonlyoptionalversion?:string
Defined in: src/module.ts:144
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get flags():
string
Defined in: src/module.ts:248
The taint characters for a module, for example OE
Returns
Section titled “Returns”string
refcnt
Section titled “refcnt”Get Signature
Section titled “Get Signature”get refcnt():
number
Defined in: src/module.ts:183
The number of references held on this module, including the ones held by holders
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get state():
ModuleState
Defined in: src/module.ts:155
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set state(
value):void
Defined in: src/module.ts:159
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Methods
Section titled “Methods”[asyncDispose]()
Section titled “[asyncDispose]()”[asyncDispose]():
Promise<void>
Defined in: src/module.ts:327
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”AsyncDisposable.[asyncDispose]
dispose()
Section titled “dispose()”dispose(
force?):Promise<void>
Defined in: src/module.ts:309
Unload a module, analogous to delete_module(2).
Parameters
Section titled “Parameters”force?
Section titled “force?”boolean = false
Unload even when the module is still referenced. This taints the module with F.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”EBUSY if the module isn’t live, or is still referenced and force isn’t set
init()
Section titled “init()”init():
Promise<void>
Defined in: src/module.ts:227
Run init.
Unlike Linux’s init_module(2), this is async since a module may need to do something
asynchronous (like fetching a resource) before it is ready. The module is init until then.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”Whatever init throws, after unloading the partially loaded module
param()
Section titled “param()”param<
T>(name):T|undefined
Defined in: src/module.ts:243
Shorthand for this.params.get(name)?.value
Type Parameters
Section titled “Type Parameters”T extends ParamValue = ParamValue
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”T | undefined
ref():
void
Defined in: src/module.ts:263
Like try_ref, but throws instead of returning false
Returns
Section titled “Returns”void
try_ref()
Section titled “try_ref()”try_ref():
boolean
Defined in: src/module.ts:256
Take a reference on a module so it can’t be unloaded.
Returns
Section titled “Returns”boolean
whether the reference was taken
unlink()
Section titled “unlink()”
protectedunlink():void
Defined in: src/module.ts:297
Remove from the list and tear down sysfs entries.
Returns
Section titled “Returns”void
unref()
Section titled “unref()”unref():
void
Defined in: src/module.ts:267
Returns
Section titled “Returns”void
unuse()
Section titled “unuse()”unuse(
target):void
Defined in: src/module.ts:286
Undo use
Parameters
Section titled “Parameters”target
Section titled “target”Module
Returns
Section titled “Returns”void
use(
target):void
Defined in: src/module.ts:275
Depend on target.
This takes a reference on target and adds a link in /sys/module/<target>/holders.
Parameters
Section titled “Parameters”target
Section titled “target”Module
Returns
Section titled “Returns”void