pub struct FileZone {
pub id: Option<i64>,
pub name: String,
pub rname: String,
pub serial: u32,
pub refresh: u32,
pub retry: u32,
pub expire: u32,
pub minimum: u32,
pub records: Vec<FileZoneRecord>,
}Expand description
A DNS Zone
Fields§
§id: Option<i64>Database row ID
name: StringMNAME The domain-name of the name server that was the original or primary source of data for this zone.
rname: String§serial: u32SERIAL - The unsigned 32 bit version number of the original copy of the zone. Zone transfers preserve this value. This value wraps and should be compared using sequence space arithmetic.
refresh: u32REFRESH - A 32 bit time interval before the zone should be refreshed.
retry: u32RETRY - A 32 bit time interval that should elapse before a failed refresh should be retried.
expire: u32EXPIRE - A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
minimum: u32MINIMUM - The unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
records: Vec<FileZoneRecord>Implementations§
source§impl FileZone
impl FileZone
pub async fn with_zone_records(self, txn: &mut SqliteConnection) -> Self
sourcepub async fn get_zone_records(
&self,
txn: &mut SqliteConnection
) -> Result<Vec<FileZoneRecord>, Error>
pub async fn get_zone_records( &self, txn: &mut SqliteConnection ) -> Result<Vec<FileZoneRecord>, Error>
the records for the zone
pub async fn get_orphans(pool: &SqlitePool) -> Result<Vec<FileZone>, Error>
Trait Implementations§
source§impl APIEntity for FileZone
impl APIEntity for FileZone
source§fn api_create<'async_trait>(
__arg0: State<Arc<RwLock<GoatChildState>>>,
session: Session,
__arg2: Json<Value>
) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>where
Self: 'async_trait,
fn api_create<'async_trait>(
__arg0: State<Arc<RwLock<GoatChildState>>>,
session: Session,
__arg2: Json<Value>
) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>where
Self: 'async_trait,
source§fn api_update<'async_trait>(
__arg0: State<Arc<RwLock<GoatChildState>>>,
session: Session,
__arg2: Json<Value>
) -> Pin<Box<dyn Future<Output = Result<Json<String>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
fn api_update<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Json<Value> ) -> Pin<Box<dyn Future<Output = Result<Json<String>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
source§fn api_delete<'async_trait>(
__arg0: State<Arc<RwLock<GoatChildState>>>,
session: Session,
__arg2: Path<i64>
) -> Pin<Box<dyn Future<Output = Result<StatusCode, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
fn api_delete<'async_trait>( __arg0: State<Arc<RwLock<GoatChildState>>>, session: Session, __arg2: Path<i64> ) -> Pin<Box<dyn Future<Output = Result<StatusCode, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>
fn api_get<'async_trait>(
__arg0: State<Arc<RwLock<GoatChildState>>>,
session: Session,
__arg2: Path<i64>
) -> Pin<Box<dyn Future<Output = Result<Json<Box<Self>>, (StatusCode, Json<ErrorResult>)>> + Send + 'async_trait>>where
Self: 'async_trait,
source§impl DBEntity for FileZone
impl DBEntity for FileZone
source§fn get<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
pool: &'life0 Pool<Sqlite>,
id: i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get by id
source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
save the entity to the database
source§fn save_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
save the entity to the database, but you’re in a transaction
source§fn create_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
_txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
_txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
create from scratch
source§fn update_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_with_txn<'t, 'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
create from scratch
source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
pool: &'life1 Pool<Sqlite>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
delete the entity from the database
source§fn delete_with_txn<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_with_txn<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 mut SqliteConnection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the entity from the database, when you’re in a transaction.
This one happens in the order ownership -> records -> zone because at the very least, if it fails after the ownership thing, then non-admin users can’t see the zone and admins will just have to clean it up manually
const TABLE: &'static str = "zones"
fn create_table<'life0, 'async_trait>(
pool: &'life0 SqlitePool
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn get_with_txn<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
id: &'life1 i64
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_by_name<'t, 'life0, 'life1, 'async_trait>(
txn: &'life0 mut SqliteConnection,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Box<Self>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_by_name<'t, 'life0, 'life1, 'async_trait>(
_txn: &'life0 mut SqliteConnection,
_name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<Self>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
't: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_user<'life0, 'async_trait>(
_pool: &'life0 Pool<Sqlite>,
_userid: i64
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<Self>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn json(&self) -> Result<String, String>where
Self: Serialize,
source§impl<'de> Deserialize<'de> for FileZone
impl<'de> Deserialize<'de> for FileZone
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>,
source§impl PartialEq for FileZone
impl PartialEq for FileZone
impl Eq for FileZone
impl StructuralEq for FileZone
impl StructuralPartialEq for FileZone
Auto Trait Implementations§
impl RefUnwindSafe for FileZone
impl Send for FileZone
impl Sync for FileZone
impl Unpin for FileZone
impl UnwindSafe for FileZone
Blanket Implementations§
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.