// loadChild reads the i'th child node of this shard from disk and returns it
// as a 'child' interface
loadChild reads the i'th child node of this shard from disk and returns it
as a 'child' interface
// loadChild reads the i ' th child node of this shard from disk and returns it // as a ' child ' interface
func (s *childer) loadChild(ctx context.Context, sliceIndex int) (*Shard, error) {
	lnk := s.link(sliceIndex)
	lnkLinkType, err := s.sd.childLinkType(lnk)
	if err != nil {
		return nil, err
	}
	var c *Shard
	if lnkLinkType == shardLink {
		nd, err := lnk.GetNode(ctx, s.dserv)
		if err != nil {
			return nil, err
		}
		cds, err := NewHamtFromDag(s.dserv, nd)
		if err != nil {
			return nil, err
		}
		c = cds
	} else {
		s, err := s.sd.makeShardValue(lnk)
		if err != nil {
			return nil, err
		}
		c = s
	}
	s.set(c, sliceIndex)
	return c, nil
}
func ( s * childer ) loadChild ( ctx context . Context , sliceIndex int ) ( * Shard , error ) { lnk := s . link ( sliceIndex ) lnkLinkType , err := s . sd . childLinkType ( lnk ) if err != nil { return nil , err } var c * Shard if lnkLinkType == shardLink { nd , err := lnk . GetNode ( ctx , s . dserv ) if err != nil { return nil , err } cds , err := NewHamtFromDag ( s . dserv , nd ) if err != nil { return nil , err } c = cds } else { s , err := s . sd . makeShardValue ( lnk ) if err != nil { return nil , err } c = s } s . set ( c , sliceIndex ) return c , nil }
loadChild reads the i'th child node of this shard from disk and returns it
as a 'child' interface
loadChild reads the i ' th child node of this shard from disk and returns it as a ' child ' interface