Skip to content

Commit

Permalink
update BaseInterfaces README
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Jul 15, 2024
1 parent dc4ccb2 commit 89e5a09
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions BaseInterfaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@ Currently this includes:
- `AbstractArray` interface: `ArrayInterface`
- `AbstractSet` interface: `SetInterface`
- `AbstractDict` interface: `DictInterface`
- `AbstractString` interface: `StringInterface`

None of these should be considered either complete or authoritative,
but they may be helpful in testing your objects basically conform.
Please make issues and PRs with missing behaviours if you find them.

Testing your object follows the interfaces is as simple as:
Declaring that it follows the interface is done with:

```julia
using BaseInterfaces, Interfaces
Interfaces.tests(DictInterface, MyDict, [mydict1, mydict2, ...])
@implements DictInterface{(:component1, :component2)} MyDict [MyDict(some_values...), MyDict(other_values...)]
```

Declaring that it follows the interface is done with:
Optional components can be chosen from `Interfaces.optional_keys(DictInterface)`.

After this you can easily test it with:

```julia
@implements DictInterface{(:component1, :component2)} MyDict
Interfaces.test(DictInterface, MyDict)
```

Where components can be chosen from `Interfaces.optional_keys(DictInterface)`.

See [the docs](https://rafaqz.github.io/Interfaces.jl/stable/) for use.

If you want to add more Base julia interfaces here, or think the existing
Expand Down

0 comments on commit 89e5a09

Please sign in to comment.