pub struct Session { /* private fields */ }Expand description
Pubky homeserver session struct.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(
pubky: &PublicKey,
capabilities: &[Capability],
user_agent: Option<String>,
) -> Self
pub fn new( pubky: &PublicKey, capabilities: &[Capability], user_agent: Option<String>, ) -> Self
Create a new session.
Sourcepub fn capabilities(&self) -> &Vec<Capability>
pub fn capabilities(&self) -> &Vec<Capability>
Returns the capabilities this session provide on this session’s pubky’s resources.
Sourcepub fn set_user_agent(&mut self, user_agent: String) -> &mut Self
pub fn set_user_agent(&mut self, user_agent: String) -> &mut Self
Set this session user agent.
Sourcepub fn set_capabilities(&mut self, capabilities: Vec<Capability>) -> &mut Self
pub fn set_capabilities(&mut self, capabilities: Vec<Capability>) -> &mut Self
Set this session’s capabilities.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize this session to its canonical binary representation.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
pub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
Deserialize this session from its canonical binary representation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Session
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more