pub struct DomainOwner {
pub project: String,
pub site: String,
}Expand description
The owner recorded in a global domain-routing index value (domain/<host>,
wildcard/<suffix>, httpchallenge/<host>/<token>). Serializes as {project, site}; a bare string deserializes as (DEFAULT_PROJECT, <string>) so a
not-yet-migrated (layout-1) index still reads correctly while the migration runs.
Note the two host-normalization schemes that key into this shared value type:
domain//wildcard/ keys canonicalize the host via Host::routing_key, while
httpchallenge//domainverify/ keys use Host::verification. They must not be
crossed — a lookup keyed under one normalization must be read under the same one.
Fields§
§project: StringThe owning project.
site: StringThe site within the project.
Implementations§
Source§impl DomainOwner
impl DomainOwner
Sourcepub fn new(project: impl Into<String>, site: impl Into<String>) -> DomainOwner
pub fn new(project: impl Into<String>, site: impl Into<String>) -> DomainOwner
A (project, site) owner.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
The canonical stored form of a domain-index value: the {project, site}
JSON object.
Sourcepub fn from_bytes(bytes: &[u8]) -> DomainOwner
pub fn from_bytes(bytes: &[u8]) -> DomainOwner
Read a domain-index value, tolerant of three on-disk forms so a reader never breaks mid-migration:
- the current
{project, site}JSON object; - a JSON bare string
"blog"→(default, "blog"); - a raw, unquoted site name
blog(the pre-0.2.0 layout, written assite.as_bytes()— not valid JSON) →(default, "blog").
Trait Implementations§
Source§impl Clone for DomainOwner
impl Clone for DomainOwner
Source§fn clone(&self) -> DomainOwner
fn clone(&self) -> DomainOwner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DomainOwner
impl Debug for DomainOwner
Source§impl<'de> Deserialize<'de> for DomainOwner
impl<'de> Deserialize<'de> for DomainOwner
Source§fn deserialize<D>(
deserializer: D,
) -> Result<DomainOwner, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<DomainOwner, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for DomainOwner
Source§impl PartialEq for DomainOwner
impl PartialEq for DomainOwner
Source§impl Serialize for DomainOwner
impl Serialize for DomainOwner
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for DomainOwner
Auto Trait Implementations§
impl Freeze for DomainOwner
impl RefUnwindSafe for DomainOwner
impl Send for DomainOwner
impl Sync for DomainOwner
impl Unpin for DomainOwner
impl UnsafeUnpin for DomainOwner
impl UnwindSafe for DomainOwner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.