The RESTful Web Services module defines a RestResource plugin. This plugin is used to define resource endpoints. They are discovered in a module's Plugin/rest/resource namespace and need to implement the \Drupal\rest\Plugin\ResourceInterface interface. Drupal 8 provides two implementations of the RestResource plugin. The first is the EntityResource class that is provided by the RESTful Web Services module. It implements a driver class that allows it to represent each entity type. The second is the Database Logging module that provides its own RestResource plugin, as well. It allows you to retrieve logged messages by IDs. The \Drupal\rest\Plugin\ResourceBase class provides an abstract base class that can be extended for the RestResource plugin implementations. If the child class provides a method that matches the available HTTP methods, it will support them. For example, if a class has only a GET method, you can only interact with that endpoint through HTTP GET requests. On the other hand, you can provide a trace method that allows an endpoint to support HTTP TRACE requests.
Drupal 8 provides two implementations of the RestResource plugin. The first is the EntityResource class that is provided by the RESTful Web Services module. It implements a deriver class that allows it to represent each entity type. The second is the Database Logging module that provides its own RestResource plugin. It allows you to retrieve logged messages by IDs.