A typical usecase for this is that when using multi sbe generated crates in a single bin crate to decode bytes. Each sbe crate may contain multi message types. So a general pattern to decode bytes was:
let frame_container = ...;
let msg_schema = frame_container.message_schema();
match msg_schema {
crate_a::SBE_SCHEMA_ID => {
// use crate_a specific ReadBuf and HeaderDecoder and ...
}
crate_b::SBE_SCHEMA_ID => {
// use crate_b specific ReadBuf and HeaderDecoder and ...
}
_ => {}
}
There currently generate following const items in message codec files:
Actually
SBE_SCHEMA_ID
andSBE_SCHEMA_VERSION
andSBE_SEMANTIC_VERSION
were crate level info, and might also be placed inlib.rs
.A typical usecase for this is that when using multi sbe generated crates in a single bin crate to decode bytes. Each sbe crate may contain multi message types. So a general pattern to decode bytes was: