我们可以 return NEAR 中的 `AccountID` 数组吗?
Can we return an array of `AccountID` in NEAR?
假设我有一个结构
pub struct Test {
pub participant: Set<AccountId>
}
然后我创建了一个新帐户并使用 insert
函数插入到参与者中,我可以使用 len()
方法获得 len
个参与者。
我怎样才能得到地址?
pub fn get_address(&self) -> Vec<AccountId> {
self.participient.contains() // can't get data
}
你可以做到
self.participant.to_vec()
假设我有一个结构
pub struct Test {
pub participant: Set<AccountId>
}
然后我创建了一个新帐户并使用 insert
函数插入到参与者中,我可以使用 len()
方法获得 len
个参与者。
我怎样才能得到地址?
pub fn get_address(&self) -> Vec<AccountId> {
self.participient.contains() // can't get data
}
你可以做到
self.participant.to_vec()