option model

This commit is contained in:
Aiden McClelland
2021-04-26 13:14:58 -06:00
parent 247c1712ba
commit 593bfb0add
6 changed files with 179 additions and 5 deletions

View File

@@ -162,6 +162,11 @@ fn build_model_struct(
#model_name(#inner_model::from(ptr))
}
}
impl AsRef<patch_db::json_ptr::JsonPointer> for #model_name {
fn as_ref(&self) -> &patch_db::json_ptr::JsonPointer {
self.0.as_ref()
}
}
impl From<patch_db::Model<#base_name>> for #model_name {
fn from(model: patch_db::Model<#base_name>) -> Self {
#model_name(#inner_model::from(patch_db::json_ptr::JsonPointer::from(model)))
@@ -237,6 +242,11 @@ fn build_model_struct(
#model_name(From::from(ptr))
}
}
impl AsRef<patch_db::json_ptr::JsonPointer> for #model_name {
fn as_ref(&self) -> &patch_db::json_ptr::JsonPointer {
self.0.as_ref()
}
}
impl From<patch_db::Model<#base_name>> for #model_name {
fn from(model: patch_db::Model<#base_name>) -> Self {
#model_name(model)