mastodon-async/entities/src
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
..
account.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
attachment.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
card.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
context.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
error.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
event.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
filter.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
instance.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
lib.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
list.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
mention.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
notification.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
push.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
relationship.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
report.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
search_result.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
status.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00
visibility.rs Add mastodon_async_entities 2023-01-04 08:29:52 -05:00