Malcontent.SessionLimitsBuilder¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
p0 |
[ |
r |
|
u0 |
r |
||
u1 |
r |
||
u2 |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Malcontent.SessionLimitsBuilder¶
Malcontent.SessionLimitsBuilder
is a stack-allocated mutable structure used to build anMalcontent.SessionLimits
instance. UseMalcontent.SessionLimitsBuilder.init
(), various method calls to set properties of the session limits, and thenMalcontent.SessionLimitsBuilder.end
(), to construct anMalcontent.SessionLimits
.New in version 0.5.0.
- classmethod new()¶
- Returns:
a new heap-allocated
Malcontent.SessionLimitsBuilder
- Return type:
Construct a new
Malcontent.SessionLimitsBuilder
on the heap. This is intended for language bindings. The returned builder must eventually be freed withMalcontent.SessionLimitsBuilder.free
(), but can be cleared zero or more times withMalcontent.SessionLimitsBuilder.clear
() first.New in version 0.5.0.
- clear()¶
Clear self, freeing any internal state in it. This will not free the top-level storage for self itself, which is assumed to be allocated on the stack.
If called on an already-cleared
Malcontent.SessionLimitsBuilder
, this function is idempotent.New in version 0.5.0.
- copy()¶
- Returns:
a copy of self
- Return type:
Copy the given self to a newly-allocated
Malcontent.SessionLimitsBuilder
on the heap. This is safe to use with cleared, stack-allocatedMalcontent.SessionLimitsBuilders
.New in version 0.5.0.
- end()¶
- Returns:
a newly constructed
Malcontent.SessionLimits
- Return type:
Finish constructing an
Malcontent.SessionLimits
with the given self, and return it. TheMalcontent.SessionLimitsBuilder
will be cleared as ifMalcontent.SessionLimitsBuilder.clear
() had been called.New in version 0.5.0.
- free()¶
Free an
Malcontent.SessionLimitsBuilder
originally allocated usingMalcontent.SessionLimitsBuilder.new
(). This must not be called on stack-allocated builders initialised usingMalcontent.SessionLimitsBuilder.init
().New in version 0.5.0.
- init()¶
Initialise the given self so it can be used to construct a new
Malcontent.SessionLimits
. self must have been allocated on the stack, and must not already be initialised.Construct the
Malcontent.SessionLimits
by calling methods on self, followed byMalcontent.SessionLimitsBuilder.end
(). To abort construction, useMalcontent.SessionLimitsBuilder.clear
().New in version 0.5.0.
- set_daily_schedule(start_time_secs, end_time_secs)¶
- Parameters:
Set the session limits in self to be a daily schedule, where sessions are allowed between start_time_secs and end_time_secs every day. start_time_secs and end_time_secs are given as offsets from the start of the day, in seconds. end_time_secs must be greater than start_time_secs. end_time_secs must be at most
24 * 60 * 60
.This will overwrite any other session limits.
New in version 0.5.0.
- set_none()¶
Unset any session limits currently set in the self.
New in version 0.5.0.