axum-cometd 0.9.3

Framework for CometD server creation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::types::{CookieId, BAYEUX_BROWSER};
use axum_extra::extract::{cookie::Cookie, CookieJar};

pub(crate) trait CookieJarExt {
    fn get_cookie_id(&self) -> Option<CookieId>;
}

impl CookieJarExt for CookieJar {
    fn get_cookie_id(&self) -> Option<CookieId> {
        self.get(BAYEUX_BROWSER)
            .map(Cookie::value)
            .map(CookieId::parse)
            .and_then(Result::ok)
    }
}