CHANGELOG v0.6.0
English
(major break of the command protocol + removal of the byte codec — the actor model is now 100% actor)
-
launch- nowself.main_train.extend_from_slice(branch), instead ofself.main_train.extend(branch.clone()), sincebranch(RouteBox) supportsCopy -
in
PurrSiding,main_trainrenamed tomain_line -
in
PurrSiding,change_rule- cut in the usual sense -
in
PurrSiding, theswitchesfield completely removed as unneeded and inconvenient -
in
PurrSiding, cut:find_index_few,find_index,find_index_many,get_switches,clear_switches- meant for working withswitches -
in
PurrSiding, new methodschange_ruleandchange_rule_few, which behave smarter, working with rules directly without unnecessary collecting -
in
PurrDesign,chainwas renamed todesign_chain, andnew_chaintochain- since it's a more fitting form of addition -
added
TrainError<T>andTrainResult<V, T>- now every function from the train section returnsTrainResult -
PurrErrorfrom the dispatcher section renamed toDispatcherError -
RouteActionandDispatcherCommandare nowCopy -
DispatcherCommand:AttachReplaceRerouteAt
now take
carriage: Tinstead ofVec<T, U>under the hood, orBytesin the original -
PurrDispatcher::dispatch- got dumber, no longer handlesAttach/Replace/RerouteAt- you're on your own with those now. And it no longer returnsOption<C>(key), but:
#[derive(Debug, Clone, Copy, MakeFull)]
pub struct DispatchData<T: PurrStep, C: PurrKey> {
#[None] pub command: Option<DispatcherCommand<T, C>>,
#[None] pub key: Option<C>,
#[None] pub carriage: Option<T>,
#[None] pub insert_position: Option<InsertPosition>,
#[None] pub line_length: Option<usize>,
#[None] pub action: Option<RouteAction>
}
with all possible data
- the error enum now looks like this:
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DispatcherError {
DuplicateInFastRoutes,
DuplicateInDynamicRoutes,
CursorNotFound,
LineChannelClosed,
RouteChannelClosed,
Internal(String),
}
LineChannelClosed and RouteChannelClosed are new: Line channel is closed, receiver dropped and Route reply channel is closed, receiver dropped
bytesandrkyvfully removed as a standard for the dispatchertrain_codec- the dispatcher's deserialization/byte-handling section fully removed from the lib
Easier client-side work - no more need to think about bytes or routes inside every client
Harder dispatcher structure and flow, since now you're required to manually handle Attach / Replace / RerouteAt commands, and the design - route - siding blueprint work moved into the dispatcher's own flow
Massive allocation optimization inside the dispatcher and stations, and in my opinion - easier work and more control, but also more responsibility.
I WILL NOT SHOVE ROUTING TIES INSIDE THE DISPATCHER. I'M FOR EXPLICIT UNDERSTANDING OF HOW THE TRACK AND DATA STORAGE WORK. SORRY.
Русский
(мажорный слом протокола команд + удаление байткодека — акторная модель теперь на 100% акторная)
-
launch- теперьself.main_train.extend_from_slice(branch), а неself.main_train.extend(branch.clone()), так какbranch(RouteBox) поддерживаетCopy -
в
PurrSiding,main_trainпереименован вmain_line -
в
PurrSiding,change_rule- вырезана в привычном смысле -
в
PurrSiding, полеswitchesполностью вырезано за ненадобностью и неудобством -
в
PurrSiding, вырезаны:find_index_few,find_index,find_index_many,get_switches,clear_switches- предназначенные для работы сswitches -
в
PurrSiding, новые методыchange_ruleиchange_rule_few, которые ведут себя более умно, сразу работая с правилами без лишнего сбора -
в
PurrDesign,chainбыл переименован вdesign_chain, аnew_chainвchain- так как является более ликвидной формой добавления -
добавлен
TrainError<T>иTrainResult<V, T>- теперь все функции из train-раздела возращают именноTrainResult -
PurrErrorиз раздела dispatcher переименован вDispatcherError -
RouteActionиDispatcherCommandтеперьCopy -
DispatcherCommand:AttachReplaceRerouteAt
теперь принимают
carriage: TвместоVec<T, U>под катом илиBytesв оригинале -
PurrDispatcher::dispatch- стал более глупым, больше не работает сAttach/Replace/RerouteAt— вы сами обязаны с ними работать. А возращает больше неOption<C>(key), а:
#[derive(Debug, Clone, Copy, MakeFull)]
pub struct DispatchData<T: PurrStep, C: PurrKey> {
#[None] pub command: Option<DispatcherCommand<T, C>>,
#[None] pub key: Option<C>,
#[None] pub carriage: Option<T>,
#[None] pub insert_position: Option<InsertPosition>,
#[None] pub line_length: Option<usize>,
#[None] pub action: Option<RouteAction>
}
со всеми возможными данными
- энум ошибок теперь выглядит так:
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DispatcherError {
DuplicateInFastRoutes,
DuplicateInDynamicRoutes,
CursorNotFound,
LineChannelClosed,
RouteChannelClosed,
Internal(String),
}
LineChannelClosed и RouteChannelClosed - новые: Line channel is closed, receiver dropped и Route reply channel is closed, receiver dropped
bytesиrkyvполностью удалены как стандарт для диспетчераtrain_codec- раздел диспетчера по десериализации и работе с байтами полностью удален из либы
Облегчение работы с клиентами - больше не нужно задумываться о байтах и маршрутах внутри каждого клиента
Усложнение структуры и потока диспетчера, так как теперь вы обязаны вручную обрабатывать команды Attach / Replace / RerouteAt, так же работа с чертежами design - route - siding переехала внутрь потока диспетчера
Гигантская оптимизация аллокаций внутри диспетчера и станций, и по моему мнению - облегчение работы и больше контроля, но и больше ответственности.
Я НЕ БУДУ СУВАТЬ МАРШРУТНЫЕ СВЯЗИ ВНУТРЬ ДИСПЕТЧЕРА. Я ЗА ЯВНОЕ ПОНИМАНИЕ РАБОТЫ ТРЕКА И ХРАНЕНИЯ ИНФОРМАЦИИ. ПРОСТИТЕ.