[][src]Struct zekin_data_structure::city::City

pub struct City { /* fields omitted */ }

城市类, 表示城市的各种基本信息

Implementations

impl City[src]

pub fn id(&self) -> &i32[src]

返回城市的唯一id

pub fn name(&self) -> &String[src]

返回城市名称

pub fn risk_level(&self) -> &RiskLevel[src]

返回城市的风险等级

pub fn start_ways(&self) -> &Vec<Rc<Way>>[src]

返回由城市出发的交通工具

impl City[src]

pub fn new(id: i32, name: String, risk_level: RiskLevel) -> City[src]

City 的构造函数,创建一个新City

Arguments

  • id - 城市的唯一id
  • risk_level - 城市的风险等级

pub fn add_way(&mut self, way: Rc<Way>)[src]

城市添加一个交通工具

Arguments

  • way - way的Rc指针

pub fn risk(&self) -> f64[src]

返回城市的风险权重系数

  • 高风险 => 0.9
  • 中风险 => 0.5
  • 低风险 => 0.2

Trait Implementations

impl Clone for City[src]

impl Debug for City[src]

impl Eq for City[src]

impl From<City> for JsValue[src]

impl FromWasmAbi for City[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl IntoWasmAbi for City[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl OptionFromWasmAbi for City[src]

impl OptionIntoWasmAbi for City[src]

impl PartialEq<City> for City[src]

impl RefFromWasmAbi for City[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, City>

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

impl RefMutFromWasmAbi for City[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, City>

Same as RefFromWasmAbi::Anchor

impl WasmDescribe for City[src]

Auto Trait Implementations

impl !RefUnwindSafe for City

impl !Send for City

impl !Sync for City

impl Unpin for City

impl !UnwindSafe for City

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.