-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Is there a way to store a byte array of a specific size?
I'm asking because I wanted to implement the ToRecord trait for my own struct Limb:
impl ToRecord for &Limb {
fn store(&self, buf: &mut std::vec::Vec<u8>) {
buf.write(&postcard::to_vec::<_, 32>(self).unwrap()).unwrap();
}
fn format_char(&self) -> u8 {
b'L'
}
fn size(&self) -> usize {
32
}
fn variable_size(&self) -> bool {
false
}
}
but I got a panic on row_format.rs on line 151:
panic!("invalid format character '{}'", a);
There seems to be more to extending the formats stored than just implementing ToRecord/FromRecord. Is there an easier way to do this? Or should I just use 's' with base64 encoding?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels