blob: a874291feb34337c0092fbd3b4aa8782fe1ef268 [file] [log] [blame] [edit]
// generated by diplomat-tool
part of 'lib.g.dart';
final class _CodePointRangeIteratorResultFfi extends ffi.Struct {
@ffi.Uint32()
external int start;
@ffi.Uint32()
external int end;
@ffi.Bool()
external bool done;
}
/// Result of a single iteration of [`CodePointRangeIterator`].
/// Logically can be considered to be an `Option<RangeInclusive<u32>>`,
///
/// `start` and `end` represent an inclusive range of code points [start, end],
/// and `done` will be true if the iterator has already finished. The last contentful
/// iteration will NOT produce a range done=true, in other words `start` and `end` are useful
/// values if and only if `done=false`.
final class CodePointRangeIteratorResult {
final int start;
final int end;
final bool done;
// This struct contains borrowed fields, so this takes in a list of
// "edges" corresponding to where each lifetime's data may have been borrowed from
// and passes it down to individual fields containing the borrow.
// This method does not attempt to handle any dependencies between lifetimes, the caller
// should handle this when constructing edge arrays.
// ignore: unused_element
CodePointRangeIteratorResult._fromFfi(_CodePointRangeIteratorResultFfi ffi)
: start = ffi.start,
end = ffi.end,
done = ffi.done;
// ignore: unused_element
_CodePointRangeIteratorResultFfi _toFfi(ffi.Allocator temp) {
final struct = ffi.Struct.create<_CodePointRangeIteratorResultFfi>();
struct.start = start;
struct.end = end;
struct.done = done;
return struct;
}
@override
bool operator ==(Object other) =>
other is CodePointRangeIteratorResult &&
other.start == start &&
other.end == end &&
other.done == done;
@override
int get hashCode => Object.hashAll([
start,
end,
done,
]);
}