pub fn lookup_schema(&self, first_id: NodeId, id: NodeId) -> Option<OffsetInfoRef> {
        if id < first_id {
            None
        } else if id < first_id + IdOffset(self.schema.id_stride * self.schema.node_count) {
            let id_offset = (id - first_id).0;
            let (div, rem) = num_integer::div_rem(id_offset, self.schema.id_stride);
            let info = self.id_offset_to_byte_offset_and_schema[rem as usize].as_ref()?;
            let byte_offset = info.byte_offset + div * self.schema.bytes_per_node;
            let parent = ParentInfo {
                parent: info.parent.parent,
                index: match info.parent.parent {
                    Some(_) => info.parent.index, // Index of parent? Used as index of child?
                    None => div as usize, // This is index within chunk at chunk top level, not index within trait.
                },
            };
            Some(OffsetInfoRef {
                byte_offset,
                schema: &info.schema,
                parent,
            })
        } else {
            None
        }
    }
/// Returns None if id not present.
Returns None if id not present.
Returns None if id not present .
pub fn lookup_schema(&self, first_id: NodeId, id: NodeId) -> Option<OffsetInfoRef> {
        if id < first_id {
            None
        } else if id < first_id + IdOffset(self.schema.id_stride * self.schema.node_count) {
            let id_offset = (id - first_id).0;
            let (div, rem) = num_integer::div_rem(id_offset, self.schema.id_stride);
            let info = self.id_offset_to_byte_offset_and_schema[rem as usize].as_ref()?;
            let byte_offset = info.byte_offset + div * self.schema.bytes_per_node;
            let parent = ParentInfo {
                parent: info.parent.parent,
                index: match info.parent.parent {
                    Some(_) => info.parent.index, // Index of parent? Used as index of child?
                    None => div as usize, // This is index within chunk at chunk top level, not index within trait.
                },
            };
            Some(OffsetInfoRef {
                byte_offset,
                schema: &info.schema,
                parent,
            })
        } else {
            None
        }
    }
pub fn lookup_schema ( & self , first_id : NodeId , id : NodeId ) -> Option < OffsetInfoRef > { if id < first_id { None } else if id < first_id + IdOffset ( self . schema . id_stride * self . schema . node_count ) { let id_offset = ( id - first_id ) . 0 ; let ( div , rem ) = num_integer :: div_rem ( id_offset , self . schema . id_stride ) ; let info = self . id_offset_to_byte_offset_and_schema [ rem as usize ] . as_ref ( ) ? ; let byte_offset = info . byte_offset + div * self . schema . bytes_per_node ; let parent = ParentInfo { parent : info . parent . parent , index : match info . parent . parent { Some ( _ ) => info . parent . index , // Index of parent? Used as index of child? None => div as usize , // This is index within chunk at chunk top level, not index within trait. } , } ; Some ( OffsetInfoRef { byte_offset , schema : & info . schema , parent , } ) } else { None } }
Returns None if id not present.
Returns None if id not present .
&self
first_id
NodeId
id
NodeId
&self
first_id
NodeId
id
NodeId