Added new session information to the queue.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
action::{Field, MsgAction},
|
||||
name::NameType,
|
||||
queue::data_director::{Include, Path, Route, SessionEntry},
|
||||
queue::data_director::{Include, Path, Route, Session},
|
||||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -41,7 +41,7 @@ pub struct Message {
|
||||
msg_id: MessageID,
|
||||
action: MsgAction,
|
||||
route: Route,
|
||||
session: SessionEntry,
|
||||
session: Session,
|
||||
}
|
||||
|
||||
impl Message {
|
||||
@@ -62,23 +62,16 @@ impl Message {
|
||||
self.session.id()
|
||||
}
|
||||
|
||||
pub fn override_session(&mut self, session: Session) {
|
||||
self.session = session;
|
||||
}
|
||||
|
||||
pub fn set_session<F>(&self, session: F) -> Self
|
||||
where
|
||||
F: Into<Field>,
|
||||
{
|
||||
/*
|
||||
let sess_id = match session.into() {
|
||||
Field::Uuid(data) => Field::Uuid(data.clone()),
|
||||
Field::StaticString(data) => match Uuid::try_from(data) {
|
||||
Ok(id) => Field::Uuid(id.clone()),
|
||||
Err(_) => Field::None,
|
||||
},
|
||||
_ => Field::None,
|
||||
};
|
||||
*/
|
||||
let mut output = self.clone();
|
||||
// output.session = sess_id;
|
||||
output.session = SessionEntry::new(session);
|
||||
output.session = Session::new(session);
|
||||
output
|
||||
}
|
||||
|
||||
@@ -122,7 +115,7 @@ impl Default for Message {
|
||||
msg_id: MessageID::new(),
|
||||
action: MsgAction::None,
|
||||
route: Route::default(),
|
||||
session: SessionEntry::new(Field::None),
|
||||
session: Session::new(Field::None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user