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:
parent
28cffdde16
commit
509f767b1f
@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user