Struct google_spectrum1_explorer::DefaultDelegate[][src]

pub struct DefaultDelegate;

A delegate with a conservative default implementation, which is used if no other delegate is set.

Trait Implementations

impl Default for DefaultDelegate
[src]

Returns the "default value" for a type. Read more

impl Delegate for DefaultDelegate
[src]

Called at the beginning of any API request. The delegate should store the method information if he is interesting in knowing more context when further calls to it are made. The matching finished() call will always be made, no matter whether or not the API request was successful. That way, the delegate may easily maintain a clean state between various API calls. Read more

Called whenever there is an HttpError, usually if there are network problems. Read more

Called whenever there is the need for your applications API key after the official authenticator implementation didn't provide one, for some reason. If this method returns None as well, the underlying operation will fail Read more

Called whenever the Authenticator didn't yield a token. The delegate may attempt to provide one, or just take it as a general information about the impending failure. The given Error provides information about why the token couldn't be acquired in the first place Read more

Called during resumable uploads to provide a URL for the impending upload. It was saved after a previous call to store_upload_url(...), and if not None, will be used instead of asking the server for a new upload URL. This is useful in case a previous resumable upload was aborted/canceled, but should now be resumed. The returned URL will be used exactly once - if it fails again and the delegate allows to retry, we will ask the server for a new upload URL. Read more

Called after we have retrieved a new upload URL for a resumable upload to store it in case we fail or cancel. That way, we can attempt to resume the upload later, see upload_url(). It will also be called with None after a successful upload, which allows the delegate to forget the URL. That way, we will not attempt to resume an upload that has already finished. Read more

Called whenever a server response could not be decoded from json. It's for informational purposes only, the caller will return with an error accordingly. Read more

Called whenever the http request returns with a non-success status code. This can involve authentication issues, or anything else that very much depends on the used API method. The delegate should check the status, header and decoded json error to decide whether to retry or not. In the latter case, the underlying call will fail. Read more

Called prior to sending the main request of the given method. It can be used to time the call or to print progress information. It's also useful as you can be sure that a request will definitely be made. Read more

Return the size of each chunk of a resumable upload. Must be a power of two, with 1<<18 being the smallest allowed chunk size. Will be called once before starting any resumable upload. Read more

Called before the given chunk is uploaded to the server. If true is returned, the upload will be interrupted. However, it may be resumable if you stored the upload URL in a previous call to store_upload_url() Read more

Called before the API request method returns, in every case. It can be used to clean up internal state between calls to the API. This call always has a matching call to begin(...). Read more

Auto Trait Implementations