Function toLockType

Converts the byte to one of the recognized lock types.

bool toLockType (
  in const(ubyte) value,
  out LockType lock
) pure nothrow @nogc @safe;

Parameters

NameDescription
value the byte containing the lock type
lock will contain the lock type if it was recognized

Returns

true if the value is a recognized opcode

Example

LockType lt;
assert(0x00.toLockType(lt) && lt == LockType.Key);
assert(0x01.toLockType(lt) && lt == LockType.KeyHash);
assert(!255.toLockType(lt));