跳转到内容

std.os.uefi.protocol.service_binding

标准库Zig 0.17.1官方原文
源码std/os/uefi/protocol/service_binding.zig

第 1 行

std.os.uefi.protocol.service_binding.cc

别名

第 7 行

别名目标 std.os.uefi.cc

std.os.uefi.protocol.service_binding.Error

别名

第 6 行

别名目标 std.os.uefi.status.Status.Error

std.os.uefi.protocol.service_binding.Guid

别名

第 3 行

别名目标 std.os.uefi.Guid

std.os.uefi.protocol.service_binding.Handle

别名

第 4 行

别名目标 std.os.uefi.Handle

std.os.uefi.protocol.service_binding.ServiceBinding

类型函数

第 9 行

pub fn ServiceBinding(service_guid: Guid) type

参数

service_guid: Guid

字段

_create_child: *const fn (*Self, *?Handle) callconv(cc) Status
_destroy_child: *const fn (*Self, Handle) callconv(cc) Status

std.os.uefi.protocol.service_binding.ServiceBinding.addToHandle

函数

第 38 行

pub fn addToHandle(self: *Self, handle: Handle) CreateChildError!void

参数

self: *Self
handle: Handle

错误

Aborted Error
AccessDenied Error
AlreadyStarted Error
BadBufferSize Error
BufferTooSmall Error
CompromisedData Error
ConnectionFin Error
ConnectionRefused Error
ConnectionReset Error
CrcError Error
DeviceError Error
EndOfFile Error
EndOfMedia Error
HostUnreachable Error
HttpError Error
IcmpError Error
IncompatibleVersion Error
InvalidLanguage Error
InvalidParameter
IpAddressConflict Error
LoadError Error
MediaChanged Error
NetworkUnreachable Error
NoMapping Error
NoMedia Error
NoResponse Error
NotFound Error
NotReady Error
NotStarted Error
OutOfResources
PortUnreachable Error
ProtocolError Error
ProtocolUnreachable Error
SecurityViolation Error
TftpError Error
Timeout Error
Unexpected UnexpectedError
Unsupported Error
VolumeCorrupted Error
VolumeFull Error
WriteProtected Error

std.os.uefi.protocol.service_binding.ServiceBinding.createChild

函数

第 27 行

要将此协议添加到现有句柄,请改用 addToHandle。

pub fn createChild(self: *Self) CreateChildError!Handle

参数

self: *Self

错误

Aborted Error
AccessDenied Error
AlreadyStarted Error
BadBufferSize Error
BufferTooSmall Error
CompromisedData Error
ConnectionFin Error
ConnectionRefused Error
ConnectionReset Error
CrcError Error
DeviceError Error
EndOfFile Error
EndOfMedia Error
HostUnreachable Error
HttpError Error
IcmpError Error
IncompatibleVersion Error
InvalidLanguage Error
InvalidParameter
IpAddressConflict Error
LoadError Error
MediaChanged Error
NetworkUnreachable Error
NoMapping Error
NoMedia Error
NoResponse Error
NotFound Error
NotReady Error
NotStarted Error
OutOfResources
PortUnreachable Error
ProtocolError Error
ProtocolUnreachable Error
SecurityViolation Error
TftpError Error
Timeout Error
Unexpected UnexpectedError
Unsupported Error
VolumeCorrupted Error
VolumeFull Error
WriteProtected Error

std.os.uefi.protocol.service_binding.ServiceBinding.CreateChildError

错误集合

第 16 行

错误

Aborted Error
AccessDenied Error
AlreadyStarted Error
BadBufferSize Error
BufferTooSmall Error
CompromisedData Error
ConnectionFin Error
ConnectionRefused Error
ConnectionReset Error
CrcError Error
DeviceError Error
EndOfFile Error
EndOfMedia Error
HostUnreachable Error
HttpError Error
IcmpError Error
IncompatibleVersion Error
InvalidLanguage Error
InvalidParameter
IpAddressConflict Error
LoadError Error
MediaChanged Error
NetworkUnreachable Error
NoMapping Error
NoMedia Error
NoResponse Error
NotFound Error
NotReady Error
NotStarted Error
OutOfResources
PortUnreachable Error
ProtocolError Error
ProtocolUnreachable Error
SecurityViolation Error
TftpError Error
Timeout Error
Unexpected UnexpectedError
Unsupported Error
VolumeCorrupted Error
VolumeFull Error
WriteProtected Error

std.os.uefi.protocol.service_binding.ServiceBinding.destroyChild

函数

第 48 行

pub fn destroyChild(self: *Self, handle: Handle) DestroyChildError!void

参数

self: *Self
handle: Handle

错误

Aborted Error
AccessDenied
AlreadyStarted Error
BadBufferSize Error
BufferTooSmall Error
CompromisedData Error
ConnectionFin Error
ConnectionRefused Error
ConnectionReset Error
CrcError Error
DeviceError Error
EndOfFile Error
EndOfMedia Error
HostUnreachable Error
HttpError Error
IcmpError Error
IncompatibleVersion Error
InvalidLanguage Error
InvalidParameter
IpAddressConflict Error
LoadError Error
MediaChanged Error
NetworkUnreachable Error
NoMapping Error
NoMedia Error
NoResponse Error
NotFound Error
NotReady Error
NotStarted Error
OutOfResources Error
PortUnreachable Error
ProtocolError Error
ProtocolUnreachable Error
SecurityViolation Error
TftpError Error
Timeout Error
Unexpected UnexpectedError
Unsupported
VolumeCorrupted Error
VolumeFull Error
WriteProtected Error

std.os.uefi.protocol.service_binding.ServiceBinding.DestroyChildError

错误集合

第 20 行

错误

Aborted Error
AccessDenied
AlreadyStarted Error
BadBufferSize Error
BufferTooSmall Error
CompromisedData Error
ConnectionFin Error
ConnectionRefused Error
ConnectionReset Error
CrcError Error
DeviceError Error
EndOfFile Error
EndOfMedia Error
HostUnreachable Error
HttpError Error
IcmpError Error
IncompatibleVersion Error
InvalidLanguage Error
InvalidParameter
IpAddressConflict Error
LoadError Error
MediaChanged Error
NetworkUnreachable Error
NoMapping Error
NoMedia Error
NoResponse Error
NotFound Error
NotReady Error
NotStarted Error
OutOfResources Error
PortUnreachable Error
ProtocolError Error
ProtocolUnreachable Error
SecurityViolation Error
TftpError Error
Timeout Error
Unexpected UnexpectedError
Unsupported
VolumeCorrupted Error
VolumeFull Error
WriteProtected Error

std.os.uefi.protocol.service_binding.ServiceBinding.guid

常量

第 58 行

std.os.uefi.protocol.service_binding.ServiceBinding.Self

别名

第 11 行

别名目标 std.os.uefi.protocol.service_binding.ServiceBinding

std.os.uefi.protocol.service_binding.Status

别名

第 5 行

别名目标 std.os.uefi.Status

std.os.uefi.protocol.service_binding.std

别名

第 1 行

别名目标 std

std.os.uefi.protocol.service_binding.uefi

别名

第 2 行

别名目标 std.os.uefi

源码

std/os/uefi/protocol/service_binding.zig

const std = @import("std");
const uefi = std.os.uefi;
const Guid = uefi.Guid;
const Handle = uefi.Handle;
const Status = uefi.Status;
const Error = Status.Error;
const cc = uefi.cc;

pub fn ServiceBinding(service_guid: Guid) type {
    return struct {
        const Self = @This();

        _create_child: *const fn (*Self, *?Handle) callconv(cc) Status,
        _destroy_child: *const fn (*Self, Handle) callconv(cc) Status,

        pub const CreateChildError = uefi.UnexpectedError || error{
            InvalidParameter,
            OutOfResources,
        } || Error;
        pub const DestroyChildError = uefi.UnexpectedError || error{
            Unsupported,
            InvalidParameter,
            AccessDenied,
        } || Error;

        /// 要将此协议添加到现有句柄,请改用 `addToHandle`。
        pub fn createChild(self: *Self) CreateChildError!Handle {
            var handle: ?Handle = null;
            switch (self._create_child(self, &handle)) {
                .success => return handle orelse error.Unexpected,
                else => |status| {
                    try status.err();
                    return uefi.unexpectedStatus(status);
                },
            }
        }

        pub fn addToHandle(self: *Self, handle: Handle) CreateChildError!void {
            switch (self._create_child(self, @ptrCast(@constCast(&handle)))) {
                .success => {},
                else => |status| {
                    try status.err();
                    return uefi.unexpectedStatus(status);
                },
            }
        }

        pub fn destroyChild(self: *Self, handle: Handle) DestroyChildError!void {
            switch (self._destroy_child(self, handle)) {
                .success => {},
                else => |status| {
                    try status.err();
                    return uefi.unexpectedStatus(status);
                },
            }
        }

        pub const guid align(8) = service_guid;
    };
}