pub struct Aircraft {
    pub basics: Basics,
    pub manufacturer: String,
    pub model: String,
    pub serial_number: String,
    pub registration_number: String,
    pub description: Option<String>,
    pub max_payload_kg: f64,
    pub max_range_km: f64,
    pub last_maintenance: Option<DateTime<Utc>>,
    pub next_maintenance: Option<DateTime<Utc>>,
    pub hangar_id: Option<String>,
}
Expand description

A struct representing an aircraft.

Fields§

§basics: Basics§manufacturer: String

The aircraft’s manufacturer.

TODO(R4): For now we can just say “Boeing”, “Airbus”, etc. Later, we can a struct for this and store the manufacturer’s name, logo, etc.

§model: String§serial_number: String§registration_number: String

The aircraft’s registration number.

In the US, this is the N number.

This is a unique identifier for the aircraft that can be used to look up information about the aircraft from national aviation authorities like the FAA.

§description: Option<String>§max_payload_kg: f64§max_range_km: f64§last_maintenance: Option<DateTime<Utc>>§next_maintenance: Option<DateTime<Utc>>§hangar_id: Option<String>

Implementations§

source§

impl Aircraft

source

pub fn full_name(&self) -> String

Get the aircraft’s name.

If the aircraft does not have a name, this will be manufacturer model registration_number.

For example, “Boeing 737-800 N12345”.

source

pub fn random() -> Self

Generate a random aircraft.

Trait Implementations§

source§

impl AssetsInfo for Aircraft

source§

fn basics(&self) -> Basics

Get the asset’s basic information.
source§

fn id(&self) -> Result<Uuid, Error>

Get the asset’s ID.
source§

fn group_id(&self) -> Result<Option<Uuid>, Error>

Get the asset’s group ID.
source§

fn name(&self) -> String

Get the asset’s name.
source§

fn owner(&self) -> Result<Uuid, Error>

Get the asset’s owner.
source§

fn created_at(&self) -> DateTime<Utc>

Get the asset’s creation time.
source§

fn updated_at(&self) -> DateTime<Utc>

Get the asset’s last update time. If the asset has never been updated, this will return None.
source§

fn is_grouped(&self) -> bool

Check if the asset is grouped.
source§

fn is_public(&self) -> bool

Check if the asset is open to the public.
source§

fn whitelist(&self) -> Result<Vec<Uuid>, Error>

Get the list of clients that have access to the asset.
source§

fn status(&self) -> AssetStatus

Get the status of the asset.
source§

impl Clone for Aircraft

source§

fn clone(&self) -> Aircraft

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Aircraft

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Aircraft

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl IntoParams for Aircraft

source§

fn into_params( parameter_in_provider: impl Fn() -> Option<ParameterIn> ) -> Vec<Parameter>

Provide Vec of [openapi::path::Parameter]s to caller. The result is used in utoipa-gen library to provide OpenAPI parameter information for the endpoint using the parameters.
source§

impl PartialEq<Aircraft> for Aircraft

source§

fn eq(&self, other: &Aircraft) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Aircraft

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'__s> ToSchema<'__s> for Aircraft

source§

fn schema() -> (&'__s str, RefOr<Schema>)

Return a tuple of name and schema or reference to a schema that can be referenced by the name or inlined directly to responses, request bodies or parameters.
§

fn aliases() -> Vec<(&'__s str, Schema), Global>

Optional set of alias schemas for the ToSchema::schema. Read more
source§

impl TryFrom<Object> for Aircraft

§

type Error = String

The type returned in the event of a conversion error.
source§

fn try_from(object: VehicleObject) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for Aircraft

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for Twhere T: Any + Clone + Send + Sync,

§

fn clone_any(&self) -> Box<dyn CloneAny, Global>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send, Global>

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync, Global>

§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Send + Sync, Global>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DebugAny for Twhere T: Any + Debug,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

§

impl<T> UnsafeAny for Twhere T: Any,