ident: member interface

For representing full identifiers of system and member.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-03-22 16:34:51 +09:00
parent c0c39f34f0
commit 1354a2c9a3
4 changed files with 31 additions and 1 deletions

View File

@@ -31,6 +31,8 @@ type S struct {
ID uint64
}
func (*S) ident() {}
const (
// SizeSystem is the size of the binary representation of [S].
SizeSystem = 24
@@ -38,6 +40,9 @@ const (
EncodedSizeSystem = SizeSystem / 3 * 4
)
// EncodedSize returns the number of bytes appended by Encode.
func (*S) EncodedSize() int { return EncodedSizeSystem }
// Encode appends the canonical string representation of sid to dst and returns
// the extended buffer.
func (sid *S) Encode(dst []byte) []byte {