[−][src]Struct koibumi_box::Manager
An inbox/outbox manager.
Implementations
impl Manager
[src]
pub async fn new(pool: SqlitePool) -> Result<Manager, Error>
[src]
Constructs an inbox/outbox manager from database connection pool.
pub async fn user<'_, '_>(&'_ self, id: &'_ [u8]) -> Result<User, Error>
[src]
Retrieves a user object specified by its ID.
pub async fn add_user<'_, '_, '_>(
&'_ self,
id: &'_ [u8],
name: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
id: &'_ [u8],
name: &'_ str
) -> Result<(), Error>
Inserts a user object.
pub async fn subscribe<'_, '_, '_>(
&'_ self,
user_id: &'_ [u8],
address: &'_ Address
) -> Result<(), Error>
[src]
&'_ self,
user_id: &'_ [u8],
address: &'_ Address
) -> Result<(), Error>
Insert a subscription address for a user.
pub async fn get_message<'_, '_, '_>(
&'_ self,
user_id: &'_ [u8],
hash: &'_ InvHash
) -> Result<Option<Message>, Error>
[src]
&'_ self,
user_id: &'_ [u8],
hash: &'_ InvHash
) -> Result<Option<Message>, Error>
Retrieves a message specified by a user ID and an inventory hash.
pub async fn insert_msg<'_, '_>(
&'_ self,
user_id: Vec<u8>,
identity: &'_ PrivateIdentity,
object: Object
) -> Result<Message, Error>
[src]
&'_ self,
user_id: Vec<u8>,
identity: &'_ PrivateIdentity,
object: Object
) -> Result<Message, Error>
Inserts a msg object.
pub async fn insert_broadcast<'_>(
&'_ self,
user_id: Vec<u8>,
address: Address,
object: Object
) -> Result<Message, Error>
[src]
&'_ self,
user_id: Vec<u8>,
address: Address,
object: Object
) -> Result<Message, Error>
Inserts a broadcast object.
pub async fn message_list<'_, '_>(
&'_ self,
user_id: &'_ [u8]
) -> Result<Vec<MessageEntry>, Error>
[src]
&'_ self,
user_id: &'_ [u8]
) -> Result<Vec<MessageEntry>, Error>
Retrieves a list of message entries for a user specified by a user ID.
pub async fn set_read<'_, '_, '_>(
&'_ self,
user_id: &'_ [u8],
hash: &'_ InvHash,
read: bool
) -> Result<(), Error>
[src]
&'_ self,
user_id: &'_ [u8],
hash: &'_ InvHash,
read: bool
) -> Result<(), Error>
Sets the read flag of the message specified by a user ID and an inventory hash.
pub async fn add_private_identity<'_, '_>(
&'_ self,
user_id: &'_ [u8],
identity: PrivateIdentity
) -> Result<(), Error>
[src]
&'_ self,
user_id: &'_ [u8],
identity: PrivateIdentity
) -> Result<(), Error>
Adds private identity in database.
pub async fn add_contact<'_, '_, '_>(
&'_ self,
user_id: &'_ [u8],
contact: &'_ Contact
) -> Result<(), Error>
[src]
&'_ self,
user_id: &'_ [u8],
contact: &'_ Contact
) -> Result<(), Error>
Insert a contact address for a user.
pub async fn add_alias<'_, '_, '_, '_>(
&'_ self,
user_id: &'_ [u8],
address: &'_ Address,
alias: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
user_id: &'_ [u8],
address: &'_ Address,
alias: &'_ str
) -> Result<(), Error>
Insert an alias.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl !UnwindSafe for Manager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,