pub struct AliasRegistry {
pub aliases: HashMap<String, String>,
pub chunks: HashMap<String, Vec<String>>,
pub reserved: Vec<String>,
}Expand description
Alias registry for tracking used aliases
Fields§
§aliases: HashMap<String, String>Map of alias path -> chunk_id
chunks: HashMap<String, Vec<String>>Map of chunk_id -> list of aliases
reserved: Vec<String>Reserved aliases that cannot be used
Implementations§
Source§impl AliasRegistry
impl AliasRegistry
Sourcepub fn is_available(&self, alias: &str) -> bool
pub fn is_available(&self, alias: &str) -> bool
Check if an alias is available
Sourcepub fn register(
&mut self,
alias: impl Into<String>,
chunk_id: impl Into<String>,
) -> bool
pub fn register( &mut self, alias: impl Into<String>, chunk_id: impl Into<String>, ) -> bool
Register an alias for a chunk
Sourcepub fn generate_unique(&self, base: &str) -> String
pub fn generate_unique(&self, base: &str) -> String
Generate a unique alias from a base name
Trait Implementations§
Source§impl Clone for AliasRegistry
impl Clone for AliasRegistry
Source§fn clone(&self) -> AliasRegistry
fn clone(&self) -> AliasRegistry
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 Debug for AliasRegistry
impl Debug for AliasRegistry
Source§impl Default for AliasRegistry
impl Default for AliasRegistry
Source§fn default() -> AliasRegistry
fn default() -> AliasRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AliasRegistry
impl<'de> Deserialize<'de> for AliasRegistry
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 AliasRegistry
impl RefUnwindSafe for AliasRegistry
impl Send for AliasRegistry
impl Sync for AliasRegistry
impl Unpin for AliasRegistry
impl UnwindSafe for AliasRegistry
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
Mutably borrows from an owned value. Read more