pub fn insert_resource<T: Resource>(&mut self, resource: T) -> Result<(), WiringError> {
        let id = ResourceId::of::<T>();
        if self.service.resources.contains_key(&id) {
            tracing::info!(
                "Layer {} has attempted to provide resource {} of type {}, but it is already available",
                self.layer,
                T::name(),
                type_name::<T>()
            );
            return Err(WiringError::ResourceAlreadyProvided {
                id: ResourceId::of::<T>(),
                name: T::name(),
            });
        }
        self.service.resources.insert(id, Box::new(resource));
        tracing::info!(
            "Layer {} has provided a new resource {}",
            self.layer,
            T::name()
        );
        Ok(())
    }
Adds a resource to the service.

If the resource with the same type is already provided, the method will return an error.
core/lib/node_framework/src/service/context.rs