mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 01:24:21 +01:00
Switch to unified timeline cache via TimelineKinds
This is a fairly large rewrite which unifies our threads, timelines and profiles. Now all timelines have a MultiSubscriber, and can be added and removed to columns just like Threads and Profiles. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -218,3 +218,15 @@ pub trait TokenSerializable: Sized {
|
||||
fn parse_from_tokens<'a>(parser: &mut TokenParser<'a>) -> Result<Self, ParseError<'a>>;
|
||||
fn serialize_tokens(&self, writer: &mut TokenWriter);
|
||||
}
|
||||
|
||||
/// Parse a 32 byte hex string
|
||||
pub fn parse_hex_id<'a>(parser: &mut TokenParser<'a>) -> Result<[u8; 32], ParseError<'a>> {
|
||||
use hex;
|
||||
|
||||
let hexid = parser.pull_token()?;
|
||||
hex::decode(hexid)
|
||||
.map_err(|_| ParseError::HexDecodeFailed)?
|
||||
.as_slice()
|
||||
.try_into()
|
||||
.map_err(|_| ParseError::HexDecodeFailed)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user