pub struct SecurityContext<'a> { /* private fields */ }Expand description
Provides a complete security context to handle packets.
To properly handle all security features of a Silkroad Online packet, you may need all three elements: SilkroadEncryption, MessageCounter, and Checksum. However, it is possible for either the SilkroadEncryption to be absent and/or both MessageCounter and Checksum to be absent. Thus, MessageCounter and Checksum are tied together. This struct does not really provide much in and of itself, but it is handy as it might be used in different layers in the stack to refer to.
Implementations§
Source§impl<'a> SecurityContext<'a>
impl<'a> SecurityContext<'a>
pub fn new( encryption: Option<&'a SilkroadEncryption>, security_bytes: Option<&'a SecurityBytes>, ) -> SecurityContext<'a>
Sourcepub fn encryption(&self) -> Option<&SilkroadEncryption>
pub fn encryption(&self) -> Option<&SilkroadEncryption>
Provide the established encryption, if present.
Sourcepub fn checkers(&self) -> Option<&SecurityBytes>
pub fn checkers(&self) -> Option<&SecurityBytes>
Provide the security bytes/checkers, if present.
Trait Implementations§
Source§impl<'a> Default for SecurityContext<'a>
impl<'a> Default for SecurityContext<'a>
Source§fn default() -> SecurityContext<'a>
fn default() -> SecurityContext<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for SecurityContext<'a>
impl<'a> RefUnwindSafe for SecurityContext<'a>
impl<'a> Send for SecurityContext<'a>
impl<'a> Sync for SecurityContext<'a>
impl<'a> Unpin for SecurityContext<'a>
impl<'a> UnwindSafe for SecurityContext<'a>
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