You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that almost every client method would have to manipulate URL, e.g. add path segments, but these methods may return error for 'cannot-be-base' URLs. So you either have to propagate this error or use unwrap, both ways are so-so.
It would be convenient to have separate type for URLs which are always can-be-base. You convert URL to this BaseURL once, pass it to client and client is sure that URL-manipulation methods are infallible.
The text was updated successfully, but these errors were encountered:
Suppose you write client for some REST service:
The problem is that almost every client method would have to manipulate URL, e.g. add path segments, but these methods may return error for 'cannot-be-base' URLs. So you either have to propagate this error or use
unwrap
, both ways are so-so.It would be convenient to have separate type for URLs which are always can-be-base. You convert URL to this BaseURL once, pass it to client and client is sure that URL-manipulation methods are infallible.
The text was updated successfully, but these errors were encountered: