github.com/zerosnake0/jzon@v0.0.9-0.20230801092939-1b135cb83f7f/val_encoder_direct.go (about)

     1  package jzon
     2  
     3  import (
     4  	"unsafe"
     5  )
     6  
     7  type directEncoder struct {
     8  	encoder ValEncoder
     9  }
    10  
    11  func (enc *directEncoder) IsEmpty(ptr unsafe.Pointer) bool {
    12  	return enc.encoder.IsEmpty(unsafe.Pointer(&ptr))
    13  }
    14  
    15  func (enc *directEncoder) Encode(ptr unsafe.Pointer, s *Streamer, opts *EncOpts) {
    16  	enc.encoder.Encode(unsafe.Pointer(&ptr), s, opts)
    17  }