pub struct NodeAllocation {
pub uuid: Uuid,
pub server: Option<Fetchable<Server>>,
pub ip: IpNetwork,
pub ip_alias: Option<CompactString>,
pub port: i32,
pub created: NaiveDateTime,
}Fields§
§uuid: Uuid§server: Option<Fetchable<Server>>§ip: IpNetwork§ip_alias: Option<CompactString>§port: i32§created: NaiveDateTimeImplementations§
Source§impl NodeAllocation
impl NodeAllocation
pub async fn create( database: &Database, node_uuid: Uuid, ip: &IpNetwork, ip_alias: Option<&str>, port: i32, ) -> Result<(), DatabaseError>
pub async fn get_random( database: &Database, node_uuid: Uuid, start_port: u16, end_port: u16, amount: i64, ) -> Result<Vec<Uuid>, DatabaseError>
pub async fn by_node_uuid_uuid( database: &Database, node_uuid: Uuid, uuid: Uuid, ) -> Result<Option<Self>, DatabaseError>
pub async fn available_by_node_uuid_with_pagination( database: &Database, node_uuid: Uuid, page: i64, per_page: i64, search: Option<&str>, ) -> Result<Pagination<Self>, DatabaseError>
pub async fn by_node_uuid_with_pagination( database: &Database, node_uuid: Uuid, page: i64, per_page: i64, search: Option<&str>, ) -> Result<Pagination<Self>, DatabaseError>
pub async fn delete_by_uuids( database: &Database, node_uuid: Uuid, uuids: &[Uuid], ) -> Result<u64, DatabaseError>
pub async fn into_admin_api_object( self, database: &Database, storage_url_retriever: &StorageUrlRetriever<'_>, ) -> Result<AdminApiNodeAllocation, DatabaseError>
Trait Implementations§
Source§impl BaseModel for NodeAllocation
impl BaseModel for NodeAllocation
Source§impl Clone for NodeAllocation
impl Clone for NodeAllocation
Source§fn clone(&self) -> NodeAllocation
fn clone(&self) -> NodeAllocation
Returns a duplicate 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<'de> Deserialize<'de> for NodeAllocation
impl<'de> Deserialize<'de> for NodeAllocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeAllocation
impl RefUnwindSafe for NodeAllocation
impl Send for NodeAllocation
impl Sync for NodeAllocation
impl Unpin for NodeAllocation
impl UnwindSafe for NodeAllocation
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more