mirror of
https://github.com/apple/swift-system
synced 2026-11-25 04:47:55 +00:00
Add a pointer convenience for getting the user data
This commit is contained in:
1 parent
9ad16c0aae
commit
880ec9086e
1 file changed
+9
-3
@@ -23,19 +23,25 @@ extension IOCompletion {
|
||||
extension IOCompletion {
|
||||
public var userData: UInt64 { //TODO: naming?
|
||||
get {
|
||||
return rawValue.user_data
|
||||
rawValue.user_data
|
||||
}
|
||||
}
|
||||
|
||||
public var userPointer: UnsafeRawPointer? {
|
||||
get {
|
||||
UnsafeRawPointer(bitPattern: UInt(rawValue.user_data))
|
||||
}
|
||||
}
|
||||
|
||||
public var result: Int32 {
|
||||
get {
|
||||
return rawValue.res
|
||||
rawValue.res
|
||||
}
|
||||
}
|
||||
|
||||
public var flags: IOCompletion.Flags {
|
||||
get {
|
||||
return Flags(rawValue: rawValue.flags & 0x0000FFFF)
|
||||
Flags(rawValue: rawValue.flags & 0x0000FFFF)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user