Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code & Test API to create new (empty) HolonTypeDescriptorBuilder #29

Open
evomimic opened this issue Mar 9, 2023 · 1 comment
Open
Assignees

Comments

@evomimic
Copy link
Owner

evomimic commented Mar 9, 2023

This is a backend story that will support creation of a new (empty) HolonTypeDescriptor. For testing purposes, we will expose this API function as an extern function so that it is callable via the Holochain Conductor. However, we intend to wrap this function behind the Uniform API + adaptor, so it will likely never actually be directly invoked from the conductor.

Per the Metaspace Design Spec this capability requires implementing the following functions:

pub trait DescriptorBuilder { // a fluent interface for setting type header attributes
    fn with_type_name(&self, type_name:String)->Self;
    fn with_description(&self, description:String)->Self;
    fn with_is_dependent(&self, is_dependent:bool)->Self;
}
pub trait HolonDescriptorBuilder: DescriptorBuilder {
    fn create()->Box<&mut dyn HolonDescriptorBuilder>; // to create an empty builder
}

NOTES:

  • For this story... the HolonTypeDescriptor will have populated TypeHeader attributes (uuid, type_name, description, semantic_type, version, created_at, is_dependent) but not any properties, actions or relationships.
  • The builder.rs file in the ...coordinator-zomes/apis/type_desc_coord_api folder currently contains a mix of trait (API) definitions and implementation logic. The implementation logic should be moved to the /impls directory as part of this story.
@evomimic
Copy link
Owner Author

I will do some research on how to properly return the trait objects so we can preserve the API vs. Implementation distinction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants