viewPeer<T> method
ViewPeer views the resource management scope for a specific peer.
Implementation
@override
Future<T> viewPeer<T>(PeerId peer, Future<T> Function(PeerScope scope) f) async {
// Assuming PeerId can be used where PeerId is expected
final scope = getPeerScopeInternal(peer);
// The cast is now valid as getPeerScopeInternal returns PeerScopeImpl
return await f(scope);
}