mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-07-12 09:05:33 +00:00
refactor(types)!: blow up big lib.rs into submods
This commit is contained in:
parent
066061e2ec
commit
8551540798
14 changed files with 778 additions and 745 deletions
|
@ -3,10 +3,12 @@ use std::path::PathBuf;
|
|||
|
||||
use anyhow::{ensure, Context};
|
||||
use blah_types::identity::UserIdentityDesc;
|
||||
use blah_types::{
|
||||
ChatPayload, Id, MemberPermission, PubKey, RoomAttrs, RoomMetadata, ServerPermission,
|
||||
SignedChatMsg, Signee, UserKey, WithMsgId,
|
||||
use blah_types::msg::{
|
||||
ChatPayload, MemberPermission, RoomAttrs, ServerPermission, SignedChatMsg, SignedChatMsgWithId,
|
||||
WithMsgId,
|
||||
};
|
||||
use blah_types::server::RoomMetadata;
|
||||
use blah_types::{Id, PubKey, Signee, UserKey};
|
||||
use parking_lot::Mutex;
|
||||
use rusqlite::{named_params, params, prepare_cached_and_bind, Connection, OpenFlags, Row};
|
||||
use serde::Deserialize;
|
||||
|
@ -127,7 +129,7 @@ impl Database {
|
|||
}
|
||||
}
|
||||
|
||||
fn parse_msg(rid: Id, row: &Row<'_>) -> Result<WithMsgId<SignedChatMsg>> {
|
||||
fn parse_msg(rid: Id, row: &Row<'_>) -> Result<SignedChatMsgWithId> {
|
||||
Ok(WithMsgId {
|
||||
cid: row.get("cid")?,
|
||||
msg: SignedChatMsg {
|
||||
|
@ -366,7 +368,7 @@ pub trait TransactionOps {
|
|||
after_cid: Id,
|
||||
before_cid: Id,
|
||||
page_len: NonZero<u32>,
|
||||
) -> Result<Vec<WithMsgId<SignedChatMsg>>> {
|
||||
) -> Result<Vec<SignedChatMsgWithId>> {
|
||||
prepare_cached_and_bind!(
|
||||
self.conn(),
|
||||
r"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue