[sq] update doc-comments

This commit is contained in:
Berkus Decker 2020-12-02 01:08:22 +02:00
parent d2982e56ff
commit b66a64fe58
1 changed files with 5 additions and 1 deletions

View File

@ -503,13 +503,17 @@ impl DerivationTreeNode {
Self(LocalRegisterCopy::new(0))
}
/// Get previous link in derivation tree.
/// Previous link exists if this is a derived capability.
///
/// SAFETY: it is UB to get prev reference from a null Prev pointer.
pub unsafe fn get_prev(&self) -> CapTableEntry {
let ptr = self.0.read(CapDerivationNode::Prev) as *const CapTableEntry;
(*ptr).clone()
}
/// Get previous link in derivation tree - this is a derived-from capability.
/// Try to get previous link in derivation tree.
/// Previous link exists if this is a derived capability.
pub fn try_get_prev(&self) -> Result<CapTableEntry, DerivationTreeError> {
if self.0.read(CapDerivationNode::Prev) == 0 {
Err(DerivationTreeError::InvalidPrev)