pub struct RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer> {
pub serde_alg: SerdeAlgKind,
pub request_kind: RequestKind,
pub endpoint: String,
pub period: Duration,
pub request_body: TClientToServer,
pub fn_process_response_success: fn(&TServerToClient) -> Vec<TMsg>,
pub fn_process_response_error: fn() -> Vec<TMsg>,
}
Expand description
Параметры периодического запроса
Fields§
§serde_alg: SerdeAlgKind
Алгоритм сериализации / десериализации
request_kind: RequestKind
Тип HTTP-запроса
endpoint: String
Путь к ресурсу
period: Duration
Периодичность вызова
request_body: TClientToServer
Параметры запроса
fn_process_response_success: fn(&TServerToClient) -> Vec<TMsg>
Функция обработки корректного ответа
fn_process_response_error: fn() -> Vec<TMsg>
Функция обработки ошибки ответа
Trait Implementations§
Source§impl<TMsg: Clone, TServerToClient: Clone, TClientToServer: Clone> Clone for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
impl<TMsg: Clone, TServerToClient: Clone, TClientToServer: Clone> Clone for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
Source§fn clone(&self) -> RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
fn clone(&self) -> RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<TMsg: Debug, TServerToClient: Debug, TClientToServer: Debug> Debug for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
impl<TMsg: Debug, TServerToClient: Debug, TClientToServer: Debug> Debug for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>
Source§impl<TMsg, TServerToClient, TClientToServer> RequestPeriodic<TMsg> for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TMsg: 'static + MsgDataBound,
TClientToServer: 'static + HttpDataBound,
TServerToClient: 'static + HttpDataBound,
impl<TMsg, TServerToClient, TClientToServer> RequestPeriodic<TMsg> for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TMsg: 'static + MsgDataBound,
TClientToServer: 'static + HttpDataBound,
TServerToClient: 'static + HttpDataBound,
Source§fn create_request(&self) -> Option<MsgRequest>
fn create_request(&self) -> Option<MsgRequest>
Создание запроса
Source§fn process_response(&self, msg_response: &MsgResponse) -> Option<Vec<TMsg>>
fn process_response(&self, msg_response: &MsgResponse) -> Option<Vec<TMsg>>
Обработка ответа
Source§fn get_period(&self) -> Duration
fn get_period(&self) -> Duration
Получить периодичность вызова
Source§fn clone_dyn(&self) -> Box<dyn RequestPeriodic<TMsg>>
fn clone_dyn(&self) -> Box<dyn RequestPeriodic<TMsg>>
Поддержка клонирования
Auto Trait Implementations§
impl<TMsg, TServerToClient, TClientToServer> Freeze for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: Freeze,
impl<TMsg, TServerToClient, TClientToServer> RefUnwindSafe for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: RefUnwindSafe,
impl<TMsg, TServerToClient, TClientToServer> Send for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: Send,
impl<TMsg, TServerToClient, TClientToServer> Sync for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: Sync,
impl<TMsg, TServerToClient, TClientToServer> Unpin for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: Unpin,
impl<TMsg, TServerToClient, TClientToServer> UnwindSafe for RequestPeriodicConfig<TMsg, TServerToClient, TClientToServer>where
TClientToServer: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more