Skip to content

std.os.uefi.protocol.service_binding

Standard libraryZig 0.17.0Official documentation
Sourcestd/os/uefi/protocol/service_binding.zig

Source line 1

std.os.uefi.protocol.service_binding.cc

alias

Source line 7

Alias of std.os.uefi.cc

std.os.uefi.protocol.service_binding.Error

alias

Source line 6

Alias of std.os.uefi.status.Status.Error

std.os.uefi.protocol.service_binding.Guid

alias

Source line 3

Alias of std.os.uefi.Guid

std.os.uefi.protocol.service_binding.Handle

alias

Source line 4

Alias of std.os.uefi.Handle

std.os.uefi.protocol.service_binding.ServiceBinding

type-function

Source line 9

pub fn ServiceBinding(service_guid: Guid) type

Parameters

service_guid: Guid

Fields

_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

function

Source line 38

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

Parameters

self: *Self
handle: Handle

Errors

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

function

Source line 27

To add this protocol to an existing handle, use addToHandle instead.

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

Parameters

self: *Self

Errors

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

error-set

Source line 16

Errors

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

function

Source line 48

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

Parameters

self: *Self
handle: Handle

Errors

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

error-set

Source line 20

Errors

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

constant

Source line 58

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

alias

Source line 11

Alias of std.os.uefi.protocol.service_binding.ServiceBinding

std.os.uefi.protocol.service_binding.Status

alias

Source line 5

Alias of std.os.uefi.Status

std.os.uefi.protocol.service_binding.std

alias

Source line 1

Alias of std

std.os.uefi.protocol.service_binding.uefi

alias

Source line 2

Alias of std.os.uefi

Source code

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;

        /// To add this protocol to an existing handle, use `addToHandle` instead.
        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;
    };
}