// Write writes a compiled ruleset to an io.Writer. func (r *Rules) Write(wr io.Writer) (err error) { var stream C.YR_STREAM stream.user_data = unsafe.Pointer(&wr) stream.write = C.YR_STREAM_WRITE_FUNC(C.stream_write) err = newError(C.yr_rules_save_stream(r.cptr, &stream)) return }
func (r *Rules) Write(w io.Writer) error { code := C.yr_rules_save_stream(r.handle, writeStream(w)) if code != C.ERROR_SUCCESS { return Error(code) } return nil }