[−][src]Struct zekin_data_structure::Module
主模块,用于统筹资源
Implementations
impl Module
[src]
pub fn cities(&self) -> &Vec<Rc<City>>
[src]
存储所有城市
pub fn ways(&self) -> &Vec<Rc<Way>>
[src]
存储所有交通方式
pub fn people(&self) -> &Vec<Rc<Person>>
[src]
存储所有乘客
pub fn time(&self) -> &i32
[src]
系统时间
impl Module
[src]
pub fn add_city(&mut self, id: i32, name: String, risk_level: RiskLevel)
[src]
添加一座城市
pub fn add_way(
&mut self,
id: i32,
way_type: Type,
cost_time: i32,
start_time: i32,
start_city_index: usize,
end_city_index: usize
) -> Result<(), ModuleErr>
[src]
&mut self,
id: i32,
way_type: Type,
cost_time: i32,
start_time: i32,
start_city_index: usize,
end_city_index: usize
) -> Result<(), ModuleErr>
添加一个交通方式
pub fn add_person(
&mut self,
start_city_index: usize,
end_city_index: usize,
time_limit: Option<i32>
) -> Result<(), ModuleErr>
[src]
&mut self,
start_city_index: usize,
end_city_index: usize,
time_limit: Option<i32>
) -> Result<(), ModuleErr>
添加一个乘客
pub fn step(&mut self)
[src]
使Module的时间前进1小时,并更新各个乘客的状态
pub fn clear(&mut self)
[src]
清理Module的数据
Trait Implementations
impl Debug for Module
[src]
impl Default for Module
[src]
impl From<Module> for JsValue
[src]
impl FromWasmAbi for Module
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for Module
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
impl OptionFromWasmAbi for Module
[src]
impl OptionIntoWasmAbi for Module
[src]
impl RefFromWasmAbi for Module
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, Module>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for Module
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, Module>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl WasmDescribe for Module
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Module
impl !Send for Module
impl !Sync for Module
impl Unpin for Module
impl !UnwindSafe for Module
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,