create static method

ZvecCollection create({
  1. required String path,
  2. required int dimension,
  3. String name = 'default',
})

Implementation

static ZvecCollection create({
  required String path,
  required int dimension,
  String name = 'default',
}) {
  final pathPointer = path.toNativeUtf8();
  final namePointer = name.toNativeUtf8();
  final out = calloc<Pointer<Void>>();

  try {
    final status = _bindings.zvecCreateCollection(
      pathPointer,
      namePointer,
      dimension,
      out,
    );
    _throwIfFailed(status);
    return ZvecCollection._(out.value);
  } finally {
    calloc.free(pathPointer);
    calloc.free(namePointer);
    calloc.free(out);
  }
}