cdrs_temp/frame/
frame_auth_success.rs

1use std::io::Cursor;
2
3use crate::error;
4use crate::frame::FromCursor;
5
6/// `BodyReqAuthSuccess` is a frame that represents a successfull authentication response.
7#[derive(Debug, PartialEq)]
8pub struct BodyReqAuthSuccess {}
9
10impl FromCursor for BodyReqAuthSuccess {
11    fn from_cursor(mut _cursor: &mut Cursor<&[u8]>) -> error::Result<BodyReqAuthSuccess> {
12        Ok(BodyReqAuthSuccess {})
13    }
14}
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19    use crate::frame::traits::FromCursor;
20    use std::io::Cursor;
21
22    #[test]
23    fn test_name() {
24        let rnd_bytes = [4, 5, 3, 8, 4, 6, 5, 0, 3, 7, 2];
25        let mut cursor: Cursor<&[u8]> = Cursor::new(&rnd_bytes);
26        let body = BodyReqAuthSuccess::from_cursor(&mut cursor).unwrap();
27        assert_eq!(body, BodyReqAuthSuccess {});
28    }
29}