Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions MemoryWriter.tryIntegral

1
2
3
4
5
6
7
8
module juptune.data.buffer;

bool tryIntegral(
    IntT, 
    Endian endian
)(
    IntT value
);

Documentation

Attempts to write an integral type into the buffer; automatically converting it from big/little endian into the native endianess, and then advances the cursor.

Notes

If the given IntTis only a byte long, then the endian parameter is ignored.

IntTcan be anything supported by std.traits.isIntegral, this includes numeric enums.

Generally, you should use the write*aliases instead of this function directly.

If you're in @gc code, then you can also use the enforce*functions instead.

If there's not enough space in the buffer, then the buffer (and cursor) are left unmodified.

Params

Returns

trueif there's enough space to write the value, falseotherwise.