Commit Graph

33 Commits

Author SHA1 Message Date
cel 🌸 e572664633
Add audio to MediaType enum 2023-06-23 14:32:42 +01:00
baummarten 1524895122 entities/Cargo.toml: time >= 0.3.16 2023-06-09 17:38:49 +02:00
Josh McKinney 1e8d7f3967 build: set the rust msrv to 1.65
necessary due to the use of workspace.package to handle inherited props
2023-04-14 16:21:35 -07:00
D. Scott Boggs e279f4bda7 Switch from the `is_variant` crate to the `derive_is_enum_variant` one. 2023-03-19 11:22:51 -04:00
D. Scott Boggs 6f5a2a5e90 Add is_variant methods to all enums 2023-02-01 15:38:48 -05:00
D. Scott Boggs d6f9617207 Use macro to define ID types 2023-01-29 09:11:44 -05:00
D. Scott Boggs 3ac64d3d08 Add description to entities crate 2023-01-29 07:03:09 -05:00
D. Scott Boggs 5f5bc8728c Add alias/convenience method 2023-01-29 06:13:53 -05:00
D. Scott Boggs b6fd884387 Add client method to wait for attachment processing 2023-01-29 06:13:53 -05:00
D. Scott Boggs e662eac46a Fix routes which take an Id type; fix doctests 2023-01-24 15:33:49 -05:00
D. Scott Boggs 53fc05d36f Add Id types to prelude and entities prelude to crate prelude 2023-01-24 15:33:49 -05:00
D. Scott Boggs be39ca6e24 Implement std::format::Display for all Id types 2023-01-24 15:33:49 -05:00
D. Scott Boggs c93e5a5020 Add static assertions 2023-01-09 09:03:21 -05:00
D. Scott Boggs fcc2035b46 Add constructors for ID types 2023-01-09 09:03:21 -05:00
D. Scott Boggs 876ac3b985 Add Mention ID type 2023-01-09 09:03:21 -05:00
D. Scott Boggs 6d8a9d6194 Add List ID type 2023-01-09 09:03:21 -05:00
D. Scott Boggs 06caec85b3 Add ID type for reports 2023-01-09 09:03:21 -05:00
D. Scott Boggs d4e7c4b59b Add ID type for relationships 2023-01-09 09:03:21 -05:00
D. Scott Boggs f4ef3c27ab Add ID type for pushes 2023-01-09 09:03:21 -05:00
D. Scott Boggs f188c20250 Add ID type for notifications 2023-01-09 09:03:21 -05:00
D. Scott Boggs c5f199b460 Add ID type for filters 2023-01-09 09:03:21 -05:00
D. Scott Boggs 9f4327f546 Add ID type for attachments 2023-01-09 09:03:21 -05:00
D. Scott Boggs 547d994d13 Add ID type for account 2023-01-09 09:03:21 -05:00
Matthias Beyer 97ae0973c3 Wrap status id in helper type
This wrapper type ensures that the status id cannot accidentially be
compared to some other string that represents something entirely else.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2023-01-09 09:03:21 -05:00
D. Scott Boggs 14dc17e582 Split status_builder module into a few files 2023-01-09 07:27:53 -05:00
D. Scott Boggs abafaf224c Add support for Filter v2 2023-01-09 07:27:53 -05:00
D. Scott Boggs 6ee2f277d8 Move legacy Filter type to mod v1; publish fields 2023-01-09 07:27:53 -05:00
D. Scott Boggs acef484b73 Finish TODO Parse DateTime before publishing this field 2023-01-09 07:27:53 -05:00
D. Scott Boggs 94624ac1db Make additional fields public 2023-01-09 07:27:53 -05:00
jhwgh1968 83e02464af Add notification type "follow request" 2023-01-09 04:51:26 -05:00
jhwgh1968 9fd1b29521 Add "poll" notification support 2023-01-09 04:51:26 -05:00
Matthias Beyer e0f38240b7 Make package fields workspace-wide
This patch makes the "version", "license", "authors" and "edition"
fields in the manifest workspace-wide.

This way we ensure that mastodon-async-entities stays in sync with
mastodon-async.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2023-01-04 08:29:52 -05:00
Matthias Beyer af3facfbf0 Add mastodon_async_entities
This patch move the entities module to a helper-crate.

With this, we give the user the opportunity to use only the entities
types in their codebase, if need be.
One scenario where this is required came up in

    https://github.com/dscottboggs/mastodon-async/issues/38

TL;DR is: A user needed to be able to pass types like `Status` from a
backend part of an application to a frontend which was compiled to WASM.
Because mastodon_async depends on tokio, which does not compile to WASM
(at least not with the features required by mastodon_async).

One option would have been to provide types in the application code
which can be constructed from mastodon_asyncs entity types. This would
lead to _a lot_ of code duplication (over several projects still,... but
that's rather undesireable anyways).

The solution mastodon_async offers with this patch is a helper-crate
which only contains the entity types: mastodon_async_entities.

mastodon_async publicly exports the whole mastodon_async_entities crate,
so users do not have to depend on the latter directly.

In addition to the `entities` module from mastodon_async, also the
`Visibility` type had to be moved.

`mastodon_async_entities` also got an own `Error` type, which
`mastodon_async::Error` can of course wrap.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Suggested-by: D. Scott Boggs <scott@tams.tech>
2023-01-04 08:29:52 -05:00