BaseInterfaces reference
Docstrings
BaseInterfaces.ArrayInterface
— Type ArrayInterface
An Interfaces.jl Interface
with mandatory components (:eltype, :ndims, :size, :getindex, :indexstyle)
and optional components (:logical, :setindex!, :similar_type, :similar_eltype, :similar_size, :similar_eltype_size)
.
Base Julia AbstractArray interface
Extended help
Mandatory keys:
eltype
ndims
size
:- size(A) returns a tuple of Integer
- length of size(A) matches ndims(A)
getindex
:- Can index with begin/firstindex
- Can index with end/lastindex
- Can index with all indices in
eachindex(A)
- Can index with Int for multiple dimensions
- Can index with Int for multiple dimensions and trailing ones
- Can index with Int for multiple dimensions and trailing colons
- Can index with CartesianIndex
- Can index with CartesianIndex and trailing ones
- Can index with CartesianIndices
- Can index with CartesianIndices and trailing ones
- Can index with CartesianIndices and trailing colons
- Can index with UnitRange
- Can index with UnitRange and trailing ones
- Can index with UnitRange and trailing colons
- Can index with StepRange
- Can index with StepRange and trailing ones
- Can index with StepRange and trailing colons
- Can index with a Vector of Int
- Can index with a Vector of Int32
- Can index with a Vector of Int with trailing ones
- Can index with a Vector of Int with trailing colons
indexstyle
: IndexStyle returns IndexCartesian or IndexLinear
Optional keys:
logical
:- Can index with logical indices
- Can index with logical indices and trailing ones
- Can index with logical indices and trailing colons
- Can index with multidimensional logical indices
- Can index with multidimensional logical indices and trailing ones
- Can index with multidimensional logical indices and trailing colons
setindex!
similar_type
:similar(A)
returns an object the same type and size asA
similar_eltype
: similar(A, T::Type) returns an object the same base type asA
with eltype ofT
similar_size
: similar(A, s::NTuple{Int}) returns an object the same type asA
with sizes
similar_eltype_size
: similar(A, T::Type, s::NTuple{Int}) returns an object the same type asA
with eltypeT
and sizes
BaseInterfaces.DictInterface
— Type DictInterface
An Interfaces.jl Interface
with mandatory components (:iterate, :eltype, :keytype, :valtype, :keys, :values, :getindex)
and optional components (:setindex!,)
.
AbstractDict
interface requires Arguments, with d = the_dict
mandatory, and when setindex
is needed, k = any_valid_key_not_in_d, v = any_valid_val
Extended help
Mandatory keys:
iterate
: AbstractDict follows the IterationInterfaceeltype
: eltype is a Pairkeytype
valtype
keys
values
getindex
Optional keys:
setindex!
:- test object
d
does not yet have test keyk
- can set key
k
to valuev
- test object
BaseInterfaces.IterationInterface
— Type IterationInterface
An Interfaces.jl Interface
with mandatory components (:iterate, :isiterable, :eltype, :size, :in)
and optional components (:reverse, :indexing)
.
An interface for Base Julia iteration
Extended help
Mandatory keys:
iterate
:- test iterator is not empty
- iterate does not return
nothing
- iterate returns a Tuple
- iterate returns a Tuple
isiterable
eltype
size
in
Optional keys:
reverse
indexing
:- can call firstindex
- can call lastindex
- can call getindex
- getindex matches iteration order
BaseInterfaces.SetInterface
— Type SetInterface
An Interfaces.jl Interface
with mandatory components (:isempty, :eltype, :length, :iteration, :in)
and optional components (:copy, :empty, :hasfastin, :setdiff, :intersect, :union, :copymutable, :emptymutable, :empty!, :delete!, :push!, :sizehint!)
.
The AbstractSet
interface
Extended help
Mandatory keys:
isempty
: definesisempty
and testdata is not emptyeltype
: elements eltype of sets
are subtypes ofeltype(s)
length
: set defines length and test object has length larger than zeroiteration
: follows the IterationInterfacein
:in
is true for elements in set
Optional keys:
copy
: creates an identical object with the same values, that is not the same objectempty
:- returns an empty set able to hold elements of type U
- returns an empty set able to hold elements of arbitrary types
hasfastin
:hasfastin
returns aBool
setdiff
:- setdiff with itself is an empty set of the same type
- setdiff with an empty set is equal to itself
intersect
:intersect
of set with itself is itselfintersect
of set with an empty set is an empty set
union
:- union of a set with itself equals itself
- union of a set an empty set equals itself
copymutable
: creates an identical mutable object with the same values, that is not the same objectemptymutable
:- returns an empty set able to hold elements of type U
- returns an empty set able to hold elements of arbitrary types
empty!
: empty! removes all elements from the setdelete!
: delete! removes element valued x of the setpush!
: push! adds an element to the setsizehint!
: can set a size hint
Index
Interfaces.Interfaces
BaseInterfaces.ArrayInterface
BaseInterfaces.DictInterface
BaseInterfaces.IterationInterface
BaseInterfaces.SetInterface
Interfaces.Arguments
Interfaces.Interface
Interfaces.components
Interfaces.description
Interfaces.implemented_trait
Interfaces.implements
Interfaces.optional_keys
Interfaces.requiredtype
Interfaces.test
Interfaces.test_objects
Interfaces.@implements
Interfaces.@interface