Skip to content

Document what works and what doesn't #23

@minecraft2048

Description

@minecraft2048

Some data types surprisingly works, and some data types unsurprisingly doesn't work

using StructIO
using EnumX
using StaticArrays

# Some data types that surprisingly works

@enumx RetCode::Int8 begin
    NO_ERROR
    INVALID_ERROR
    HELLO_WORLD
    STREIBOUGH
end

@io struct Reply
    rc::RetCode.T
    result::Int
end align_packed #StructIO works with EnumX enums

@io struct Nested
    msgid::UInt8
    msg::Reply
end align_packed #StructIO can successfully deserialize nested structs

@io struct Fixed
    num::Int
    vec::SVector{16,UInt8}
end align_packed #StructIO works with StaticArrays

#Some data types that doesn't work

@io struct Cursed
    st::String
    num::Int
end align_packed # Unsurprisingly doesn't work as string is a variable length array

@io struct Trailing
    num::Int
    vec::Vector{UInt8}
end align_packed 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions