hi @laura, thank for your fast reply 
So basically the pub_interface trait provided us the features such as secret contract & UI invocation.
And if I only define the public functions right in a contract & didn’t use pub_interface, I just can call them within in my contract & for console testing only, right?
Then, I will use pub_interface trait and implement it later.
Let me make it more clear so that you can take a closer look on it.
I have a data struct below:
#[derive(Serialize, Deserialize)]
pub struct Creator {
creator: H256,
dataCollections: Vec<DataCollection>, // Vector Data Collections
status: String,
CreatedAt: DateTime<Utc>,
}
If I implement the public function right in contract implementation, it will look like this:
pub fn insert_data_collection(&mut self, dcType: String, format: String, dc_owner: H256) {
let owner: String = dc_owner.to_hex();
self.dataCollections.push(DataCollection {
dcType,
format,
owner
});
write_state!(DATACOLLECTIONS => &self.dataCollections);
}
And if I use the pub_interface trait, I will modify function above into the private function in the contract then in the contract implementation for public ones, I will call that private function.
impl CreatorInterface for Contract {
//.........
fn append_data_collection(dcType: String, format: String, dc_owner: H256) {
// do sth....
// call the private function above
Self::insert_data_collection(dcType, format, dc_owner); // NOTE: the Rust compiler will throw the error missing parameters! I suspect that it is the self one
}
}
Because in the private function I modified the data, that’s why I define &mut self.
I need a way so that I can modify self data / call the private function from here.