create CallbackInfo.new_with_literal method

reason: CallbackInfo with literal and without created in completly
differrent usecases, so it will be easier to code with differrent
functions instead of passing Option each time
This commit is contained in:
Akulij 2025-05-01 14:53:14 +03:00
parent 28cffdde16
commit 509f767b1f

View File

@ -34,6 +34,15 @@ where
} }
} }
pub fn new_with_literal(callback: C, literal: String) -> Self {
Self {
_id: Default::default(),
created_at: Local::now().into(),
literal: Some(literal),
callback,
}
}
pub fn get_id(&self) -> String { pub fn get_id(&self) -> String {
self._id.to_hex() self._id.to_hex()
} }